clientinfo.h
00001 /* 00002 Calendar and client access for KDE Alarm Daemon. 00003 00004 This file is part of the KDE alarm daemon. 00005 Copyright (c) 2001 David Jarvie <software@astrojar.org.uk> 00006 Based on the original, (c) 1998, 1999 Preston Brown 00007 00008 This program is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00021 00022 As a special exception, permission is given to link this program 00023 with any edition of Qt, and distribute the resulting executable, 00024 without including the source code for Qt in the source distribution. 00025 */ 00026 00027 #ifndef _CALCLIENT_H 00028 #define _CALCLIENT_H 00029 00030 #include <qstrlist.h> 00031 00032 #include <libkcal/calendarlocal.h> 00033 00034 #include "adcalendarbase.h" 00035 00036 using namespace KCal; 00037 00038 class ADCalendar; // this class must be derived from ADCalendarBase 00039 00040 00041 // Alarm Daemon client which receives calendar events 00042 struct ClientInfo 00043 { 00044 enum NotificationType // how to notify client about events if client isn't running 00045 { 00046 NO_START_NOTIFY = 0, // don't start client if it isn't running 00047 DCOP_NOTIFY = 1, // start client and use DCOP to notify about events 00048 COMMAND_LINE_NOTIFY = 2, // start client and use command line arguments to notify about events 00049 DCOP_SIMPLE_NOTIFY = 3 // Use simple DCOP call to notify about events 00050 }; 00051 ClientInfo() : mValid( false ) { } 00052 ClientInfo(const QCString &appName, const QString &title, 00053 const QCString &dcopObj, int notifyType, bool disp, 00054 bool wait=false); 00055 00056 void setNotificationType(int type); 00057 00058 QCString appName; 00059 QString title; // application title for display purposes 00060 QCString dcopObject; // object to receive DCOP messages (if applicable) 00061 NotificationType notificationType; // whether and how to notify events if client app isn't running 00062 bool displayCalName; // true to display calendar name in tooltip 00063 // Data which is not used by all alarm daemon applications 00064 bool waitForRegistration; // don't notify any events until client has registered 00065 int menuIndex; // context menu index to this client's entry 00066 00067 bool isValid() const { return mValid; } 00068 00069 private: 00070 bool mValid; 00071 }; 00072 00073 //typedef QMap<QString, ClientInfo> ClientMap; // maps client names against client data 00074 00075 typedef QValueList<ClientInfo> ClientList; 00076 00077 #endif