~ubuntu-branches/ubuntu/intrepid/knutclient/intrepid

« back to all changes in this revision

Viewing changes to knutclient/knutupsdata.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2007-03-08 16:08:31 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070308160831-0kes374x4jhkcea5
Tags: 0.9.3-1ubuntu1
* UVE Exception: New Upstream release
* Fixes BTS #410405 (FTBFS on x86_64)
* debian/rules:
  - commented out dh_iconcache call
* debian/control:
  - Added Ubuntu MOTU Maintainer Field
  - Moved old Maintainer field to Original-Maintainer
* debian/changelog:
  - Merged Ubuntu Changelog entries

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
                          knutupsdata.h  -  description
3
 
                             -------------------
4
 
    begin                : Tue Aug 21 2001
5
 
    copyright            : (C) 2001 by Daniel Prynych
6
 
    email                : Daniel.Prynych@alo.cz
7
 
 ***************************************************************************/
8
 
 
9
 
/***************************************************************************
10
 
 *                                                                         *
11
 
 *   This program is free software; you can redistribute it and/or modify  *
12
 
 *   it under the terms of the GNU General Public License as published by  *
13
 
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 
 *   (at your option) any later version.                                   *
15
 
 *                                                                         *
16
 
 ***************************************************************************/
17
 
 
18
 
#ifndef KNUTUPSDATA_H
19
 
#define KNUTUPSDATA_H
20
 
 
21
 
#include "knutconst.h"
22
 
#include "kanalog.h"
23
 
 
24
 
#include <qstring.h>
25
 
#include <qvaluelist.h>
26
 
 
27
 
class QString;
28
 
 
29
 
/**
30
 
  *@author Daniel Prynych
31
 
  */
32
 
 
33
 
struct upsRecord {
34
 
  QString name; // jmeno
35
 
  QString upsName; // name of UPSky <> mojeups
36
 
  QString upsAddress; // address of UPS <> muj.pc.cz
37
 
  long delay;
38
 
  unsigned int port;
39
 
  bool tcp;
40
 
  QString userName;
41
 
  QString password;
42
 
  bool savePassword;
43
 
  int upsVarCode[knc::NumberOfVars];
44
 
  };
45
 
 
46
 
 
47
 
 /**
48
 
  * Trida obsahuje data o UPS-kach,
49
 
  * nazev, adresu port, protokol, promenne atd.
50
 
  *
51
 
  * @author Daniel Prynych
52
 
  * @short Informace o UPS
53
 
  * @version 0.3
54
 
  **/
55
 
class KNutUpsData {
56
 
 
57
 
public:
58
 
 /**
59
 
  * Konstruktor
60
 
  *
61
 
  * @since  0.2
62
 
  **/
63
 
  KNutUpsData();
64
 
 
65
 
 /**
66
 
  * Destruktor
67
 
  *
68
 
  * @since  0.2
69
 
  **/
70
 
  ~KNutUpsData();
71
 
 
72
 
 /**
73
 
  * Prida zaznam.
74
 
  *
75
 
  * @param upsMember Jsou data zaznamu ve strukture UpsInfo.
76
 
  * @since  0.3
77
 
  **/
78
 
  void add (const upsRecord upsMember);
79
 
 
80
 
 /**
81
 
  * Prepise zaznam.
82
 
  *
83
 
  * @param index Udava poradove cislo zaznamu..
84
 
  * @param upsMember Jsou data zaznamu ve strukture UpsInfo.
85
 
  * @since  0.3
86
 
  **/
87
 
  void put (const int index, const upsRecord upsMember );
88
 
 
89
 
 /**
90
 
  * Vrati zaznam.
91
 
  *
92
 
  * @param index Udava poradove cislo zaznamu.
93
 
  * @param upsMember Jsou data zaznamu ve strukture UpsInfo.
94
 
  *
95
 
  * @since  0.3
96
 
  **/
97
 
  void get (const int index, upsRecord& upsMember );
98
 
 
99
 
 /**
100
 
  * Vrati jmeno zaznamu.
101
 
  *
102
 
  * @param index Udava poradove cislo zaznamu.
103
 
  * @since  0.2
104
 
  **/
105
 
  QString getName (const int index);
106
 
 
107
 
 /**
108
 
  * Zrusi zaznam.
109
 
  *
110
 
  * @param index Udava poradove cislo zaznamu.
111
 
  *
112
 
  * @since  0.2
113
 
  **/
114
 
  void deleteName (const int index);
115
 
 
116
 
 /**
117
 
  * Vrati pocet zaznamu.
118
 
  *
119
 
  * @since  0.2
120
 
  **/
121
 
  int getCount ( void );
122
 
 
123
 
 /**
124
 
  * Vrati ukazatel na zaznam, pokud zaznam neexistuje vrati 0.
125
 
  *
126
 
  * @param name Je jmeno zaznamu.
127
 
  * @since  0.2
128
 
  **/
129
 
  upsRecord* findName (const QString name);
130
 
 
131
 
 
132
 
 
133
 
private:
134
 
  int countMembers;
135
 
 
136
 
 QValueList<upsRecord> listRecords;
137
 
};
138
 
 
139
 
 
140
 
#endif