~ubuntu-branches/ubuntu/lucid/kdebase/lucid

« back to all changes in this revision

Viewing changes to khelpcenter/history.h

  • Committer: Bazaar Package Importer
  • Author(s): Ana Beatriz Guerrero Lopez
  • Date: 2009-04-05 05:22:13 UTC
  • mfrom: (0.4.2 experimental) (0.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 235.
  • Revision ID: james.westby@ubuntu.com-20090405052213-39thr4l6p2ss07uj
Tags: 4:4.2.2-1
* New upstream release:
  - khtml fixes. (Closes: #290285, #359680)
  - Default konsole sessions can be deleted. (Closes: #286342)
  - Tag widget uses standard application palette. (Closes: #444800)
  - ... and surely many more but we have lost track...

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  This file is part of the KDE Help Center
3
 
 *
4
 
 *  Copyright (C) 2002 Frerich Raabe <raabe@kde.org>
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; either version 2 of the License, or
9
 
 *  (at your option) any later version.
10
 
 *
11
 
 *  This program is distributed in the hope that it will be useful,
12
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 *  GNU General Public License for more details.
15
 
 *
16
 
 *  You should have received a copy of the GNU General Public License
17
 
 *  along with this program; if not, write to the Free Software
18
 
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19
 
 */
20
 
#ifndef HISTORY_H
21
 
#define HISTORY_H
22
 
 
23
 
#include <kurl.h>
24
 
 
25
 
#include <qobject.h>
26
 
#include <qptrlist.h>
27
 
 
28
 
class KActionCollection;
29
 
class KMainWindow;
30
 
class KToolBarPopupAction;
31
 
class QPopupMenu;
32
 
 
33
 
namespace KHC {
34
 
 
35
 
class View;
36
 
 
37
 
class History : public QObject
38
 
{
39
 
    Q_OBJECT
40
 
  public:
41
 
    friend class foo; // to make gcc shut up
42
 
    struct Entry
43
 
    {
44
 
      Entry() : view( 0 ), search( false ) {}
45
 
 
46
 
      View *view;
47
 
      KURL url;
48
 
      QString title;
49
 
      QByteArray buffer;
50
 
      bool search;
51
 
    };
52
 
 
53
 
    static History &self();
54
 
 
55
 
    void setupActions( KActionCollection *coll );
56
 
    void updateActions();
57
 
 
58
 
    void installMenuBarHook( KMainWindow *mainWindow );
59
 
 
60
 
    void createEntry();
61
 
    void updateCurrentEntry( KHC::View *view );
62
 
 
63
 
  signals:
64
 
    void goInternalUrl( const KURL & );
65
 
    void goUrl( const KURL & );
66
 
 
67
 
  private slots:
68
 
    void backActivated( int id );
69
 
    void fillBackMenu();
70
 
    void forwardActivated( int id );
71
 
    void fillForwardMenu();
72
 
    void goMenuActivated( int id );
73
 
    void fillGoMenu();
74
 
    void back();
75
 
    void forward();
76
 
    void goHistoryActivated( int steps );
77
 
    void goHistory( int steps );
78
 
    void goHistoryDelayed();
79
 
 
80
 
  private:
81
 
    History();
82
 
    History( const History &rhs );
83
 
    History &operator=( const History &rhs );
84
 
    ~History();
85
 
 
86
 
    bool canGoBack() const;
87
 
    bool canGoForward() const;
88
 
    void fillHistoryPopup( QPopupMenu *, bool, bool, bool, uint = 0 );
89
 
 
90
 
    static History *m_instance;
91
 
 
92
 
    QPtrList<Entry> m_entries;
93
 
 
94
 
 
95
 
    int m_goBuffer;
96
 
    int m_goMenuIndex;
97
 
    int m_goMenuHistoryStartPos;
98
 
    int m_goMenuHistoryCurrentPos;
99
 
  public:
100
 
    KToolBarPopupAction *m_backAction;
101
 
    KToolBarPopupAction *m_forwardAction;
102
 
};
103
 
 
104
 
}
105
 
 
106
 
#endif // HISTORY_H
107
 
// vim:ts=2:sw=2:et