~ubuntu-branches/ubuntu/vivid/aptitude/vivid

« back to all changes in this revision

Viewing changes to src/qt/widgets/tab.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2011-06-22 12:32:56 UTC
  • mfrom: (1.8.6 sid)
  • Revision ID: james.westby@ubuntu.com-20110622123256-8aox9w9ch3x72dci
Tags: 0.6.4-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/05aptitude: never autoremove kernels
  - drop aptitude-doc to Suggests
  - 03_branding.dpatch: ubuntu branding
  - 04_changelog.dpatch: take changelogs from changelogs.ubuntu.com
  - 09_ubuntu_fortify_source.dpatch: Suppress a number of warnings (turned
    into errors by -Werror) triggered by Ubuntu's default of
    -D_FORTIFY_SOURCE=2.
  - 11_ubuntu_uses_sudo.dpatch: fix status line of 'Become root' menu entry
    to not refer to su.
  - 12_point_manpage_to_doc_package.dpatch: point Finnish manpage to the
    correct place for further info
  - 14_html2text_preferred.dpatch: switch back to html2text in favor of
    elinks, since html2text is in main and elinks isn't.
* dropped 01_intltool_update.dpatch
* updated 15_ftbfs_new_apt

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** \file tab.h */   // -*-c++-*-
 
2
//
 
3
// Copyright (C) 2010 Piotr Galiszewski
 
4
//
 
5
// This program is free software; you can redistribute it and/or
 
6
// modify it under the terms of the GNU General Public License as
 
7
// published by the Free Software Foundation; either version 2 of the
 
8
// License, or (at your option) any later version.
 
9
//
 
10
// This program is distributed in the hope that it will be useful, but
 
11
// WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
// General Public License for more details.
 
14
//
 
15
// You should have received a copy of the GNU General Public License
 
16
// along with this program; see the file COPYING.  If not, write to
 
17
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
18
// Boston, MA 02111-1307, USA.
 
19
 
 
20
#ifndef APTITUDE_QT_TAB_H
 
21
#define APTITUDE_QT_TAB_H
 
22
 
 
23
#include <QtCore/QObject>
 
24
#include <QtGui/QWidget>
 
25
 
 
26
namespace aptitude
 
27
{
 
28
  namespace gui
 
29
  {
 
30
    namespace qt
 
31
    {
 
32
      /** \brief tab is a base class for tabs shown in main window's tab widget.
 
33
       *
 
34
       *
 
35
       *  Every tab has a name, which will be displayed in the UI, and a type,
 
36
       *  indicating which of the UI pages it implements
 
37
       */
 
38
      class tab : public QWidget
 
39
      {
 
40
        Q_OBJECT
 
41
 
 
42
      public:
 
43
        /** \brief Indicates tab type */
 
44
        enum tab_type
 
45
          {
 
46
            tab_packages,
 
47
            tab_info,
 
48
            tab_preview,
 
49
            tab_resolver,
 
50
            tab_perform
 
51
          };
 
52
 
 
53
        /** \brief What to do when the tab is closed. */
 
54
        enum closing_policy
 
55
          {
 
56
            /** Destroy the tab when it's closed. */
 
57
            closing_policy_destroy,
 
58
            /** Hide the tab when it's closed. */
 
59
            closing_policy_hide,
 
60
          };
 
61
 
 
62
        const QString name;
 
63
 
 
64
        const tab_type type;
 
65
        const closing_policy policy;
 
66
 
 
67
        /** \todo Shouldn't this be const? */
 
68
        QString description;
 
69
 
 
70
      public:
 
71
        /** \brief Create a new tab object with the given type and parent. */
 
72
        explicit tab(tab_type type, closing_policy _policy, QWidget *parent = 0);
 
73
 
 
74
        virtual ~tab();
 
75
 
 
76
        /** \brief Retrieve the name of this tab. */
 
77
        const QString & get_name() const { return name; }
 
78
 
 
79
        /** \brief Retrieve the description of this tab.
 
80
         *
 
81
         *  The description is used as the tooltip of the tab.
 
82
         */
 
83
        const QString & get_description() const { return description; }
 
84
 
 
85
        /** \brief Retrieve the type of this tab. */
 
86
        tab_type get_type() { return type; }
 
87
 
 
88
        /** \brief Retrieve the closing policy of this tab. */
 
89
        closing_policy get_policy() { return policy; }
 
90
 
 
91
      };
 
92
    }
 
93
  }
 
94
}
 
95
 
 
96
#endif // APTITUDE_QT_TAB_H