summaryrefslogtreecommitdiffstats
path: root/kweather/dockwidget.h
blob: 54ce388ffef935566012398a3d9294f775b0e4a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/***************************************************************************
                          dockwidget.h  -  description
                             -------------------
    begin                : Thu Jul 6 2000
    copyright            : (C) 2000-2003 by Ian Reinhart Geiser
                         : (C) 2002-2003 Nadeem Hasan <nhasan@kde.org>
    email                : geiseri@msoe.edu
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
#ifndef DOCKWIDGET_H
#define DOCKWIDGET_H

#include <tqfont.h>
#include <tqpixmap.h>
#include <tqwidget.h>

#include <dcopref.h>

class TQLabel;
class WeatherService_stub;
class WeatherButton;

class dockwidget : public TQWidget
{
    Q_OBJECT
  TQ_OBJECT

public:
    dockwidget(const TQString &location, TQWidget *parent=0, const char *name=0);
    ~dockwidget();

    enum {ShowIconOnly=1, ShowTempOnly=2, ShowAll=3 };

    void setLocationCode(const TQString &locationCode);
    void setViewMode(int);
    void setOrientation(Qt::Orientation o) { m_orientation = o; }
    /** resize the view **/
    void resizeView(const TQSize &size);
    int widthForHeight(int h);
    int heightForWidth(int w);

public  slots:
    void showWeather();

signals: // Signals
    void buttonClicked();

private:
    void initDock();
    void updateFont();

    int m_mode;
    TQString m_locationCode;
    TQFont m_font;
    TQPixmap m_icon;
    WeatherButton *m_button;
    TQLabel *m_lblTemp;
    TQLabel *m_lblWind;
    TQLabel *m_lblPres;
    Qt::Orientation m_orientation;

    WeatherService_stub *m_weatherService;
};

#endif

// vim:ts=4:sw=4:et