• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

ktimetracker

  • sources
  • kde-4.12
  • kdepim
  • ktimetracker
desktoptracker.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2003 by Tomas Pospisek <tpo@sourcepole.ch>
3  * 2007 the ktimetracker developers
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the
17  * Free Software Foundation, Inc.
18  * 51 Franklin Street, Fifth Floor
19  * Boston, MA 02110-1301 USA.
20  *
21  */
22 
23 #ifndef KTIMETRACKER_DESKTOP_TRACKER_H
24 #define KTIMETRACKER_DESKTOP_TRACKER_H
25 
26 #include <QObject>
27 #include <QVector>
28 
29 #include "desktoplist.h"
30 
31 class Task;
32 class QTimer;
33 
34 typedef QVector<Task *> TaskVector;
35 const int maxDesktops = 20;
36 
42 class DesktopTracker : public QObject
43 {
44  Q_OBJECT
45 
46  public:
47  DesktopTracker();
54  QString startTracking();
55  void registerForDesktops( Task* task, DesktopList dl );
56  int desktopCount() const { return mDesktopCount; }
57 
58  private: // member variables
59 
60  // define vectors for at most 16 virtual desktops
61  // E.g.: desktopTrackerStop[3] contains a vector with
62  // all tasks to be notified, when switching to/from desk 3.
63  TaskVector mDesktopTracker[maxDesktops];
64  int mPreviousDesktop;
65  int mDesktopCount;
66  int mDesktop;
67  QTimer *mTimer;
68 
69  Q_SIGNALS:
70  void reachedActiveDesktop( Task* task );
71  void leftActiveDesktop( Task* task );
72 
73  public Q_SLOTS:
74  void handleDesktopChange( int desktop );
75 
76  private Q_SLOTS:
77  void changeTimers();
78 };
79 
80 #endif // KTIMETRACKER_DESKTOP_TRACKER_H
DesktopTracker::leftActiveDesktop
void leftActiveDesktop(Task *task)
TaskVector
QVector< Task * > TaskVector
Definition: desktoptracker.h:32
DesktopTracker::DesktopTracker
DesktopTracker()
Definition: desktoptracker.cpp:30
DesktopTracker::desktopCount
int desktopCount() const
Definition: desktoptracker.h:56
QObject
desktoplist.h
DesktopTracker::handleDesktopChange
void handleDesktopChange(int desktop)
Definition: desktoptracker.cpp:50
maxDesktops
const int maxDesktops
Definition: desktoptracker.h:35
DesktopList
QVector< int > DesktopList
Definition: desktoplist.h:28
DesktopTracker::startTracking
QString startTracking()
Start time tracking of tasks by virtual desktop.
Definition: desktoptracker.cpp:80
DesktopTracker::registerForDesktops
void registerForDesktops(Task *task, DesktopList dl)
Definition: desktoptracker.cpp:98
DesktopTracker
A utility to associate tasks with desktops As soon as a desktop is activated/left - an signal is emit...
Definition: desktoptracker.h:42
Task
A class representing a task.
Definition: task.h:54
DesktopTracker::reachedActiveDesktop
void reachedActiveDesktop(Task *task)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ktimetracker

Skip menu "ktimetracker"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal