Added include path for libv4l2 includes, rather than assuming they are
[kdenetwork.git] / kopete / libkopete / kopeteglobal.h
blob97ca79f8a50391482245e8ca58e4db86741a1944
1 /*
2 kopeteglobal.h - Kopete Globals
4 Copyright (c) 2004 by Richard Smith <kde@metafoo.co.uk>
6 Kopete (c) 2004 by the Kopete developers <kopete-devel@kde.org>
8 *************************************************************************
9 * *
10 * This library is free software; you can redistribute it and/or *
11 * modify it under the terms of the GNU Lesser General Public *
12 * License as published by the Free Software Foundation; either *
13 * version 2 of the License, or (at your option) any later version. *
14 * *
15 *************************************************************************
18 #ifndef KOPETEGLOBAL_H
19 #define KOPETEGLOBAL_H
21 #include "kopeteproperty.h"
23 #include "kopete_export.h"
25 /**
26 * This namespace contains all of Kopete's core classes and functions.
28 namespace Kopete
31 /**
32 * This namespace contains Kopete's global settings and functions
34 namespace Global
36 class PropertiesPrivate;
38 /**
39 * \brief Global facility to query/store templates that are needed by KopeteProperty
41 * Basically all a plugin author needs to worry about is creating PropertyTmpl
42 * objects for all the properties he wants to set for a Kopete::Contact,
43 * everything else is handled behind the scenes.
44 **/
45 class KOPETE_EXPORT Properties
47 friend class Kopete::PropertyTmpl;
48 public:
49 /**
50 * \brief Singleton accessor for this class.
52 * Use it to access the global list of property-templates or to get
53 * a reference to one of the common PropertyTmpl objects
55 static Properties *self();
57 /**
58 * Return a template with defined by @p key, if no such template has
59 * been registered PropertyTmpl::null will be returned
61 const PropertyTmpl &tmpl(const QString &key) const;
63 /**
64 * @return a ready-to-use template for a contact's full name.
66 * This is actually no real property, it makes use of
67 * firstName() and lastName() to assemble an name that consists of
68 * both name parts
70 const PropertyTmpl &fullName() const;
72 /**
73 * Return default template for a contact's idle-time
75 const PropertyTmpl &idleTime() const;
76 /**
77 * Return default template for a contact's online-since time
78 * (i.e. time since he went from offline to online)
80 const PropertyTmpl &onlineSince() const;
81 /**
82 * @return default template for a contact's last-seen time
84 const PropertyTmpl &lastSeen() const;
85 /**
86 * @return default template for a contact's status title
88 const PropertyTmpl &statusTitle() const;
89 /**
90 * @return default template for a contact's status message
92 const PropertyTmpl &statusMessage() const;
93 /**
94 * @return default template for a contact's first name
96 const PropertyTmpl &firstName() const;
97 /**
98 * @return default template for a contact's last name
100 const PropertyTmpl &lastName() const;
102 * @return default template for a contact's email-address
104 const PropertyTmpl &emailAddress() const;
106 * @return default template for a contact's private phone number
108 const PropertyTmpl &privatePhone() const;
110 * @return default template for a contact's private mobile number
112 const PropertyTmpl &privateMobilePhone() const;
114 * @return default template for a contact's work phone number
116 const PropertyTmpl &workPhone() const;
118 * @return default template for a contact's work mobile number
120 const PropertyTmpl &workMobilePhone() const;
122 * @return default template for a contact's nickname (set by the contact)
124 const PropertyTmpl &nickName() const;
126 * default template for a contact's photo.
128 * It could be either a QString or a QImage.
129 * If it's a QString, it should points to the path the image is stored.
131 const PropertyTmpl &photo() const;
134 * @return a map of all registered PropertyTmpl object
136 const PropertyTmpl::Map &templateMap() const;
139 * return true if a template with key @p key is already registered,
140 * false otherwise
142 bool isRegistered(const QString &key);
144 private:
145 Properties();
146 ~Properties();
148 bool registerTemplate(const QString &key,
149 const PropertyTmpl &tmpl);
150 void unregisterTemplate(const QString &key);
152 const PropertyTmpl &createProp(const QString &key,
153 const QString &label, const QString &icon=QString(),
154 bool persistent = false) const;
156 private:
157 static Properties *mSelf;
158 PropertiesPrivate *d;
159 }; // end class Properties
161 } // Global
163 } // Kopete
165 #endif
166 // vim: set noet ts=4 sts=4 sw=4: