make webinterface translatable. there are around 20 short strings, all with context...
[kdenetwork.git] / kopete / libkopete / kopetegroup.h
blob99de47291c3497c54858932c6d59164287fb1d5f
1 /*
2 kopetegroup.h - Kopete (Meta)Contact Group
4 Copyright (c) 2002-2005 by Olivier Goffart <ogoffart@kde.org>
5 Copyright (c) 2003 by Martijn Klingens <klingens@kde.org>
7 Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
9 *************************************************************************
10 * *
11 * This library is free software; you can redistribute it and/or *
12 * modify it under the terms of the GNU Lesser General Public *
13 * License as published by the Free Software Foundation; either *
14 * version 2 of the License, or (at your option) any later version. *
15 * *
16 *************************************************************************
19 #ifndef KOPETEGROUP_H
20 #define KOPETEGROUP_H
22 #include <QtCore/QList>
24 #include "kopetecontactlistelement.h"
26 #include "kopete_export.h"
29 namespace Kopete {
32 class MetaContact;
33 class Message;
35 /**
36 * Class which represents the Group.
38 * A Group is a ConstacListElement which means plugin can save data.
40 * some static group are availavle from this class: topLevel and temporary
42 * @author Olivier Goffart <ogoffart@kde.org>
44 class KOPETE_EXPORT Group : public ContactListElement
46 Q_PROPERTY( QString displayName READ displayName WRITE setDisplayName )
47 Q_PROPERTY( uint groupId READ groupId )
48 Q_PROPERTY( bool expanded READ isExpanded WRITE setExpanded )
50 Q_OBJECT
52 public:
53 typedef QList<Group*> List;
55 /** Kinds of groups. */
56 enum GroupType { Normal=0, Temporary, TopLevel };
58 /**
59 * \brief Create an empty group
61 * Note that the constructor will not add the group automatically to the contact list.
62 * Use @ref ContactList::addGroup() to add it
64 Group();
66 /**
67 * \brief Create a group of the specified type
69 * Overloaded constructor to create a group with a display name of the specified type.
71 explicit Group( const QString &displayName, GroupType type = Normal );
73 ~Group();
75 /**
76 * \brief Return the group's display name
78 * \return the display name of the group
80 QString displayName() const;
82 /**
83 * \brief Rename the group
85 void setDisplayName( const QString &newName );
87 /**
88 * \return the group type
90 GroupType type() const;
92 /**
93 * \brief Set the group type
95 void setType( GroupType newType );
97 /**
98 * \return the unique id for this group
100 uint groupId() const;
103 * @brief child metacontact
104 * This function is not very efficient - it searches through all the metacontacts in the contact list
105 * \return the members of this group
107 QList<MetaContact *> members() const;
110 * \brief Set if the group is expanded.
112 void setExpanded( bool expanded );
116 * \return true if the group is expanded.
117 * \return false otherwise
119 bool isExpanded() const;
122 * \return a Group pointer to the toplevel group
124 static Group *topLevel();
127 * \return a Group pointer to the temporary group
129 static Group *temporary();
132 * @internal
134 void setGroupId( uint groupId );
137 * @internal
139 uint uniqueGroupId() const;
141 * @internal
143 void setUniqueGroupId( uint uniqueGroupId );
145 public slots:
147 * Send a message to all contacts in the group
149 void sendMessage();
152 signals:
154 * \brief Emitted when the group has been renamed
156 void displayNameChanged( Kopete::Group *group , const QString &oldName );
159 private slots:
160 void sendMessage( Kopete::Message& );
162 private:
163 static Group *s_topLevel;
164 static Group *s_temporary;
166 class Private;
167 Private *d;
170 * @internal used to get reachabe contact to send message to thom.
172 QList<MetaContact *> onlineMembers() const;
175 } //END namespace Kopete
177 #endif