lib

KoProperty Namespace Reference

Classes

class  Buffer
 
class  CustomProperty
 
class  Editor
 
class  EditorItem
 
class  FactoryManager
 
class  GroupContainer
 
class  PointCustomProperty
 
class  Property
 
class  RectCustomProperty
 
class  Set
 
class  SizeCustomProperty
 
class  SizePolicyCustomProperty
 
class  Widget
 
class  WidgetProxy
 

Enumerations

enum  PropertyType {
  Auto = TQVariant::Invalid - 1 , Invalid = TQVariant::Invalid , Map = TQVariant::Map , List = TQVariant::List ,
  String = TQVariant::String , StringList = TQVariant::StringList , Font = TQVariant::Font , Pixmap = TQVariant::Pixmap ,
  Rect = TQVariant::Rect , Size = TQVariant::Size , Color = TQVariant::Color , Point = TQVariant::Point ,
  Integer = TQVariant::Int , Boolean = TQVariant::Bool , Double = TQVariant::Double , CString = TQVariant::CString ,
  Cursor = TQVariant::Cursor , SizePolicy = TQVariant::SizePolicy , Date = TQVariant::Date , Time = TQVariant::Time ,
  DateTime = TQVariant::DateTime , ValueFromList = 2000 , Symbol = 2001 , FontName ,
  FileURL , PictureFileURL , DirectoryURL , LineStyle ,
  Size_Height = 3001 , Size_Width , Point_X , Point_Y ,
  Rect_X , Rect_Y , Rect_Width , Rect_Height ,
  SizePolicy_HorData , SizePolicy_VerData , SizePolicy_HorStretch , SizePolicy_VerStretch ,
  UserDefined = 4000
}
 

Functions

bool hasParent (TQObject *par, TQObject *o)
 
static void paintListViewExpander (TQPainter *p, TQWidget *w, int height, const TQColorGroup &cg, bool isOpen)
 
virtual CustomProperty * createCustomProperty (Property *parent)=0
 
virtual Widget * createCustomWidget (Property *property)=0
 
KOPROPERTY_EXPORT TQMap< TQCString, TQVariant > propertyValues (const Set &set)
 

Variables

static bool kofficeAppDirAdded = false
 
static Property Set_nonConstNull
 

Detailed Description

Namespace for a set of classes implementing generic properties framework.

Main classes of this framework are:

  • Property, representing a single property with its own type and value
  • Set, a set of properties
  • Editor, a widget for displaying and editing properties provided by a Set object. Every property has its own row displayed using EditorItem object, within Editor widget. Widget class provides editing feature for EditorItem objects if a user selects a given item.

KoProperty framework also supports adding custom property types and custom property editor types using Custom Property and CustomPropertyFactory. If you cannot store your value type in a TQVariant, consider using composed properties (see FactoryManager for more information) or storing it in CustomProperty yourself with handleValue() set to true.

Take a look at the test application, available in /koproperty/test to see how to use KoProperty.

Author
Cedric Pasteur cedri.nosp@m.c.pa.nosp@m.steur.nosp@m.@fre.nosp@m.e.fr
Alexander Dymo cloud.nosp@m.temp.nosp@m.le@ms.nosp@m.kat..nosp@m.net
Jaroslaw Staniek js@ii.nosp@m.dea..nosp@m.pl

Enumeration Type Documentation

◆ PropertyType

Helper function to create a value list from two string lists. *‍/ KOPROPERTY_EXPORT TQStringVariantMap createValueListFromStringLists( const TQStringList &keys, const TQStringList &values);

/*! PropertyType. Integers that represent the type of the property. Plugin defined properties should have a type number >= UserDefined .

Enumerator
Invalid 

invalid property type

Map 

TQStringVariantMap.

List 

TQValueList<TQVariant>

String 

string

StringList 

string list

Font 

font

Pixmap 

pixmap

Rect 

rectangle (x,y, width, height)

Todo:
implement TQVariant::Brush
Size 

size (width, height)

Color 

color

Point 

point (x,y)

Todo:

implement TQVariant::Palette

implement TQVariant::ColorGroup

implement TQVariant::IconSet

Integer 

integer

Todo:
implement TQVariant::Image
Boolean 

boolean

Todo:
implement TQVariant::UInt
Double 

double

Cursor 

cursor

Todo:

implement TQVariant::PointArray

implement TQVariant::Region

implement TQVariant::Bitmap

SizePolicy 

size policy (horizontal, vertical)

Date 

date

Time 

time

DateTime 

date and time

ValueFromList 

string value from a list

Todo:

implement TQVariant::ByteArray

implement TQVariant::BitArray

implement TQVariant::KeySequence

implement TQVariant::Pen

implement TQVariant::Long

implement TQVariant::LongLong

implement TQVariant::ULongLong

Symbol 

unicode symbol code

FontName 

font name, e.g.

"times new roman"

FileURL 

url of a file

PictureFileURL 

url of a pixmap

DirectoryURL 

url of a directory

LineStyle 

line style

UserDefined 

plugin defined properties should start here

Definition at line 65 of file property.h.

Function Documentation

◆ createCustomProperty()

virtual CustomProperty * KoProperty::createCustomProperty ( Property *  parent)
pure virtual

A prototype for custom property factory class KOPROPERTY_EXPORT CustomPropertyFactory : public TQObject { public: CustomPropertyFactory(TQObject *parent); virtual ~CustomPropertyFactory();.

A pointer to factory function which creates and returns widget for a given property type.*‍/ typedef Widget *(createWidget) (Property); typedef CustomProperty *(createCustomProperty) (Property);

!

/*!

Returns
a new instance of custom property for parent. Implement this for property types you want to support. Use parent->type() to get type of the property.

◆ createCustomWidget()

virtual Widget * KoProperty::createCustomWidget ( Property *  property)
pure virtual
Returns
a new instance of custom property for property. Implement this for property editor types you want to support. Use parent->type() to get type of the property.

◆ hasParent()

bool KoProperty::hasParent ( TQObject *  par,
TQObject *  o 
)
inline
Returns
true if o has parent par.

Definition at line 54 of file editor.cpp.

◆ paintListViewExpander()

static void KoProperty::paintListViewExpander ( TQPainter *  p,
TQWidget *  w,
int  height,
const TQColorGroup &  cg,
bool  isOpen 
)
static

Definition at line 57 of file editoritem.cpp.

◆ propertyValues()

TQMap< TQCString, TQVariant > KoProperty::propertyValues ( const Set &  set)

Definition at line 526 of file set.cpp.

Variable Documentation

◆ kofficeAppDirAdded

bool KoProperty::kofficeAppDirAdded = false
static

Definition at line 50 of file editor.cpp.

◆ Set_nonConstNull

Property KoProperty::Set_nonConstNull
static

Definition at line 39 of file set.cpp.