~ubuntu-branches/ubuntu/precise/kdocker/precise

« back to all changes in this revision

Viewing changes to src/customtraylabel.h

  • Committer: Bazaar Package Importer
  • Author(s): Lorenzo Villani
  • Date: 2006-07-24 16:58:25 UTC
  • Revision ID: james.westby@ubuntu.com-20060724165825-tcir4glqacf9eno0
Tags: upstream-1.3
ImportĀ upstreamĀ versionĀ 1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 *  Copyright (C) 2004 Girish Ramakrishnan All Rights Reserved.
 
3
 *      
 
4
 * This is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; either version 2 of the License, or
 
7
 * (at your option) any later version.
 
8
 * 
 
9
 * This software is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 * 
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this software; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
 
17
 * USA.
 
18
 */
 
19
 
 
20
// $Id: customtraylabel.h,v 1.8 2005/02/09 03:38:00 cs19713 Exp $
 
21
 
 
22
#ifndef _CUSTOMTRAYLABEL_H
 
23
#define _CUSTOMTRAYLABEL_H
 
24
 
 
25
#include <qaction.h>
 
26
#include "qtraylabel.h"
 
27
 
 
28
class QStringList;
 
29
class QPopupMenu;
 
30
class QString;
 
31
class QSettings;
 
32
class QWidget;
 
33
class QDropEvent;
 
34
 
 
35
class CustomTrayLabel : public QTrayLabel
 
36
{
 
37
  Q_OBJECT
 
38
 
 
39
public:
 
40
  CustomTrayLabel(Window w, QWidget* p = 0, const QString& t = QString::null);
 
41
  CustomTrayLabel(const QStringList& argv, pid_t pid, QWidget* parent = 0);
 
42
 
 
43
  // Session management
 
44
  bool saveState(QSettings& settings);
 
45
  bool restoreState(QSettings& settings);
 
46
 
 
47
  bool isLaunchOnStartup(void) const   { return mAutoLaunch->isOn(); }
 
48
  bool isDockWhenObscured(void) const { return mDockWhenObscured->isOn(); }
 
49
  
 
50
  void setAppName(const QString& name);
 
51
 
 
52
public slots:
 
53
  // overridden to update our menu
 
54
  void setDockWhenMinimized(bool dwm);
 
55
  void setSkipTaskbar(bool skip);
 
56
 
 
57
  void setLaunchOnStartup(bool launch);
 
58
  void setDockWhenObscured(bool dock) { mDockWhenObscured->setOn(dock); }
 
59
  void enableSessionManagement(bool sm) { mSessionManagement->setOn(sm); }
 
60
  
 
61
protected:
 
62
  void dropEvent(QDropEvent *ev);
 
63
  bool canUnsubscribeFromRoot(void);
 
64
  void mapEvent(void);
 
65
  void obscureEvent(void);
 
66
  void destroyEvent(void);
 
67
  void mouseReleaseEvent(QMouseEvent * ev);
 
68
  bool canDockWindow(Window w);
 
69
  void processDead(void);
 
70
 
 
71
private slots:
 
72
  void setCustomIcon(void);
 
73
  void updateMenu();
 
74
  void slotSetBalloonTimeout(void);
 
75
  void slotSetLaunchOnStartup(void);
 
76
  
 
77
private:
 
78
  void installMenu();
 
79
  bool mUndockWhenDead;
 
80
  QPopupMenu *mOptionsMenu, *mMainMenu;
 
81
  QAction *mDockOnRestore, *mAutoLaunch, *mBalloonTimeout, *mSkipTaskbar,
 
82
          *mDockWhenMinimized, *mDockWhenObscured, *mSessionManagement;
 
83
  int mShowId;
 
84
};
 
85
 
 
86
#endif // _CUSTOMTRAYLABEL_H