~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to libkdepim/kweekdaycheckcombo.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C) 2010 Casey Link <unnamedrambler@gmail.com>
 
3
    Copyright (c) 2010 Bertjan Broeksema <broeksema@kde.org>
 
4
    Copyright (C) 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
 
5
 
 
6
    This library is free software; you can redistribute it and/or modify it
 
7
    under the terms of the GNU Library General Public License as published by
 
8
    the Free Software Foundation; either version 2 of the License, or (at your
 
9
    option) any later version.
 
10
 
 
11
    This library is distributed in the hope that it will be useful, but WITHOUT
 
12
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
13
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
 
14
    License for more details.
 
15
 
 
16
    You should have received a copy of the GNU Library General Public License
 
17
    along with this library; see the file COPYING.LIB.  If not, write to the
 
18
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
19
    02110-1301, USA.
 
20
*/
 
21
 
 
22
#ifndef KWEEKDAYCHECKCOMBO_H
 
23
#define KWEEKDAYCHECKCOMBO_H
 
24
 
 
25
#include "kcheckcombobox.h"
 
26
 
 
27
#include "kdepim_export.h"
 
28
 
 
29
#include <QBitArray>
 
30
#include <QDate>
 
31
 
 
32
namespace KPIM {
 
33
 
 
34
//FIXME: This class assumes all weeks have 7 days. We should use KCalenderSystem instead.
 
35
/**
 
36
 * A combobox that is populated with the days of the week from the current
 
37
 * KCalenderSystem. The days are checkable.
 
38
 * @note: KCalenderSystem numbers weekdays starting with 1, however this widget is 0 indexed and handles the conversion to the 1 based system internally. Use this widget as a normal 0 indexed container.
 
39
 * @see KCalenderSystem
 
40
 */
 
41
class KDEPIM_EXPORT KWeekdayCheckCombo : public KCheckComboBox
 
42
{
 
43
 
 
44
  Q_OBJECT
 
45
public:
 
46
   /**
 
47
    * @param first5Checked if true the first 5 weekdays will be checked by default
 
48
    */
 
49
    KWeekdayCheckCombo( QWidget *parent = 0, bool first5Checked = false );
 
50
    virtual ~KWeekdayCheckCombo();
 
51
 
 
52
    /**
 
53
     * Retrieve the checked days
 
54
     * @param days a 7 bit array indicating the checked days (bit 0 = Monday, value 1 = checked).
 
55
     */
 
56
    QBitArray days() const;
 
57
 
 
58
    /**
 
59
     * Set the checked days on this combobox
 
60
     * @param days a 7 bit array indicating the days to check/uncheck (bit 0 = Monday, value 1 = check).
 
61
     * @param disableDays if not empty, the corresponding days will be disabled, all others enabled (bit 0 = Monday, value 1 = disable).
 
62
     * @see days()
 
63
     */
 
64
    void setDays( const QBitArray &days, const QBitArray &disableDays = QBitArray() );
 
65
 
 
66
    /**
 
67
     * Returns the index of the weekday represented by the
 
68
     * QDate object.
 
69
     */
 
70
    int weekdayIndex( const QDate &date ) const;
 
71
};
 
72
 
 
73
}
 
74
#endif // KWEEKDAYCHECKCOMBO_H