Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.59 KB | None | 0 0
  1. /*
  2.     Copyright (c) 2010, Stijn Leenknegt
  3.     All rights reserved.
  4.  
  5.     Redistribution and use in source and binary forms, with or without
  6.     modification, are permitted provided that the following conditions are met:
  7.         * Redistributions of source code must retain the above copyright
  8.         notice, this list of conditions and the following disclaimer.
  9.         * Redistributions in binary form must reproduce the above copyright
  10.         notice, this list of conditions and the following disclaimer in the
  11.         documentation and/or other materials provided with the distribution.
  12.         * Neither the name of the KHL nor the
  13.         names of its contributors may be used to endorse or promote products
  14.         derived from this software without specific prior written permission.
  15.  
  16.     THIS SOFTWARE IS PROVIDED BY Stijn Leenknegt ''AS IS'' AND ANY
  17.     EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18.     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19.     DISCLAIMED. IN NO EVENT SHALL Stijn Leenknegt BE LIABLE FOR ANY
  20.     DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21.     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22.     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23.     ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24.     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25.     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26.  
  27. */
  28.  
  29. #ifndef KHLUURROOSTER_HEADER
  30. #define KHLUURROOSTER_HEADER
  31.  
  32. #include <Plasma/Applet>
  33. #include <kconfigdialog.h>
  34. #include <QString>
  35. #include <QTimer>
  36. #include <QDate>
  37. #include <QTime>
  38. #include <QGraphicsGridLayout>
  39. #include <QGraphicsLinearLayout>
  40. #include <Plasma/Label>
  41. #include <Plasma/PushButton>
  42. #include <Plasma/ScrollWidget>
  43. #include <QGraphicsWidget>
  44.  
  45. #include "ui_config.h"
  46. #include "uurrooster.h"
  47.  
  48. class QSizeF;
  49.  
  50. // Define our plasma Applet
  51. class KHLUurrooster : public Plasma::Applet
  52. {
  53.     Q_OBJECT
  54.     public:
  55.         // Basic Create/Destroy
  56.         KHLUurrooster(QObject *parent, const QVariantList &args);
  57.         ~KHLUurrooster();
  58.  
  59.         // The paintInterface procedure paints the applet to screen
  60.         void paintInterface(QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect& contentsRect);
  61.         void init();
  62.         void displayError(const QString &error);
  63.        
  64.     private slots:
  65.         void configAccepted();
  66.         void updateRoosters();
  67.         void sendNextIcalLink();
  68.        
  69.     public slots:
  70.         void createConfigurationInterface(KConfigDialog *parent);
  71.         void configChanged();
  72.         void roosterError(const QString &error);
  73.         void nextDate();
  74.         void prevDate();
  75.  
  76.     private:
  77.         Ui::config ui;
  78.         QDate date;
  79.         int ical_busy;
  80.         QString ical_1;
  81.         QString ical_2;
  82.         QString ical_3;
  83.         QString ical_1_color;
  84.         QString ical_2_color;
  85.         QString ical_3_color;
  86.         QTimer *timer;
  87.         QGraphicsGridLayout *layout;
  88.         Uurrooster *rooster;
  89.         Plasma::Label *headerLabel;
  90.         Plasma::PushButton *vorigeButton;
  91.         Plasma::PushButton *volgendeButton;
  92.         Plasma::ScrollWidget *m_scrollWidget;
  93.         QGraphicsWidget *m_scroller;
  94.         QGraphicsLinearLayout *m_scrollerLayout;
  95.        
  96.         void displayEntries();
  97.         void readConfig();
  98. };
  99.  
  100. // This is the command that links your applet to the .desktop file
  101. K_EXPORT_PLASMA_APPLET(khluurrooster, KHLUurrooster)
  102. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement