kalarmd Library API Documentation

dockwindow.h

00001 /*
00002     KDE Panel docking window for KDE Alarm Daemon GUI.
00003 
00004     Copyright (c) 2001 David Jarvie <software@astrojar.org.uk>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 #ifndef _DOCKWINDOW_H
00025 #define _DOCKWINDOW_H
00026 // $Id: dockwindow.h,v 1.10 2002/01/16 16:57:02 cschumac Exp $
00027 
00028 #include <ksystemtray.h>
00029 #include <kpopupmenu.h>
00030 
00031 #include "alarmgui.h"
00032 
00033 class AlarmDockWindow : public KSystemTray
00034 {
00035     Q_OBJECT
00036   public:
00037     AlarmDockWindow(AlarmGui *, QWidget *parent = 0L, const char *name = 0L);
00038     virtual ~AlarmDockWindow();
00039 
00040     bool alarmsOn()        { return contextMenu()->isItemChecked(mAlarmsEnabledId); }
00041     bool autostartGuiOn()  { return contextMenu()->isItemChecked(mAutostartGuiId); }
00042 
00043     void setGuiAutostart(bool on);
00044     void setDaemonAutostart(bool on)   { contextMenu()->setItemChecked(mAutostartDaemonId, on); }
00045     void updateMenuClients();
00046     void updateMenuCalendars(bool recreate);
00047     void setDaemonStatus(bool running);
00048     void addToolTip(const QString&);
00049 
00050   protected:
00051     virtual void contextMenuAboutToShow(KPopupMenu*);
00052     void mousePressEvent(QMouseEvent*);
00053     void closeEvent(QCloseEvent*);
00054 
00055   public slots:
00056     void toggleAlarmsEnabled();
00057     void toggleGuiAutostart()     { setGuiAutostart(!autostartGuiOn()); }
00058     void toggleDaemonAutostart();
00059     void selectClient(int menuIndex);
00060     void selectCal(int menuIndex);
00061 
00062   protected:
00063     QPixmap    mPixmapEnabled, mPixmapDisabled;
00064     int        mAlarmsEnabledId;     // alarms enabled item in menu
00065     int        mAutostartGuiId;      // GUI autostart item in menu
00066     int        mAutostartDaemonId;   // daemon autostart item in menu
00067 
00068   private:
00069     // DCOP interface
00070     void       handleEvent(const QString& calendarURL, const QString& eventID);
00071 
00072     AlarmGui   *mAlarmGui;
00073     QString    mDefaultClient;       // default application name
00074     int        mClientIndex;         // menu index to client names separator
00075     int        mNumClientIds;        // number of client names + 1 in menu
00076     int        mNumCalendarIds;      // number of calendar URLs + 1 in menu
00077     bool       mSettingDaemonStatus; // to avoid recursion in setDaemonStatus()
00078 };
00079 
00080 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:22 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001