Warning, file /network/ktp-contact-list/global-presence-chooser.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * Global Presence - A Drop down menu for selecting presence 0003 * 0004 * Copyright (C) 2011 David Edmundson <kde@davidedmundson.co.uk> 0005 * 0006 * This library is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU Lesser General Public 0008 * License as published by the Free Software Foundation; either 0009 * version 2.1 of the License, or (at your option) any later version. 0010 * 0011 * This library is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0014 * Lesser General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU Lesser General Public 0017 * License along with this library; if not, write to the Free Software 0018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 0019 */ 0020 0021 #ifndef GLOBALPRESENCECHOOSER_H 0022 #define GLOBALPRESENCECHOOSER_H 0023 0024 #include <KComboBox> 0025 0026 #include <KTp/global-presence.h> 0027 #include <KTp/presence.h> 0028 0029 class QMenu; 0030 class QPushButton; 0031 class KPixmapSequenceOverlayPainter; 0032 class PresenceModelExtended; 0033 0034 namespace KTp { 0035 class GlobalPresence; 0036 class PresenceModel; 0037 } 0038 0039 extern const QString KDED_STATUS_MESSAGE_PARSER_WHATSTHIS; 0040 0041 class GlobalPresenceChooser : public KComboBox 0042 { 0043 Q_OBJECT 0044 public: 0045 explicit GlobalPresenceChooser(QWidget *parent = 0); 0046 0047 void repositionOverlays(); 0048 0049 KTp::GlobalPresence *globalPresence() {return m_globalPresence;}; 0050 0051 protected: 0052 virtual bool event(QEvent *event); 0053 virtual void setEditable(bool editable); /** Hides overlay and calls ancestor's method. */ 0054 0055 private Q_SLOTS: 0056 void onUserActivatedComboChange(int index); 0057 void onAllComboChanges(int index); 0058 void onPresenceChanged(const KTp::Presence &presence); 0059 void onConnectionStatusChanged(KTp::GlobalPresence::ConnectionStatus connectionStatus); 0060 void onChangePresenceMessageClicked(); 0061 void onConfirmPresenceMessageClicked(); 0062 0063 private: 0064 KTp::GlobalPresence *m_globalPresence; 0065 KTp::PresenceModel *m_model; 0066 PresenceModelExtended *m_modelExtended; 0067 0068 KPixmapSequenceOverlayPainter *m_busyOverlay; 0069 QPushButton *m_changePresenceMessageButton; 0070 QPointer<QMenu> m_lineEditContextMenu; 0071 }; 0072 0073 #endif // GLOBALPRESENCECHOOSER_H