• 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
focusdetectornotifier.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007 by Mathias Soeken <msoeken@tzi.de>
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 #include "focusdetectornotifier.h"
23 
24 #include "focusdetector.h"
25 #include "taskview.h"
26 
27 //@cond PRIVATE
28 class FocusDetectorNotifier::Private
29 {
30 public:
31  Private()
32  {
33  mDetector = new FocusDetector();
34  }
35  ~Private()
36  {
37  delete mDetector;
38  }
39  FocusDetector *mDetector;
40  QList< TaskView * > mViews;
41 };
42 //@endcond
43 
44 FocusDetectorNotifier* FocusDetectorNotifier::mInstance = 0;
45 
46 FocusDetectorNotifier::FocusDetectorNotifier( QObject *parent )
47  : QObject( parent ), d( new Private() )
48 {
49 }
50 
51 FocusDetectorNotifier* FocusDetectorNotifier::instance()
52 {
53  if ( !mInstance )
54  {
55  mInstance = new FocusDetectorNotifier;
56  }
57  return mInstance;
58 }
59 
60 FocusDetectorNotifier::~FocusDetectorNotifier()
61 {
62  delete d;
63 }
64 
65 void FocusDetectorNotifier::attach( TaskView *view )
66 {
67  d->mViews.append( view );
68  if ( d->mViews.count() == 1 )
69  {
70  //d->mDetector->startFocusDetection();
71  }
72 }
73 
74 void FocusDetectorNotifier::detach( TaskView *view )
75 {
76  d->mViews.removeAll( view );
77  if ( d->mViews.count() == 0)
78  {
79  //d->mDetector->stopFocusDetection();
80  }
81 }
82 
83 FocusDetector *FocusDetectorNotifier::focusDetector() const
84 {
85  return d->mDetector;
86 }
87 
88 #include "focusdetectornotifier.moc"
FocusDetectorNotifier::instance
static FocusDetectorNotifier * instance()
Definition: focusdetectornotifier.cpp:51
FocusDetectorNotifier::detach
void detach(TaskView *view)
Definition: focusdetectornotifier.cpp:74
FocusDetectorNotifier
Manages the FocusDetector for multiple TaskView instances, so only one timer is used for all...
Definition: focusdetectornotifier.h:38
QObject
taskview.h
FocusDetectorNotifier::~FocusDetectorNotifier
virtual ~FocusDetectorNotifier()
Definition: focusdetectornotifier.cpp:60
focusdetector.h
focusdetectornotifier.h
FocusDetector
Keep track of what window has the focus.
Definition: focusdetector.h:36
FocusDetectorNotifier::focusDetector
FocusDetector * focusDetector() const
Definition: focusdetectornotifier.cpp:83
TaskView
Container and interface for the tasks.
Definition: taskview.h:50
FocusDetectorNotifier::attach
void attach(TaskView *view)
Definition: focusdetectornotifier.cpp:65
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