diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kplato/kptresource.h | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kplato/kptresource.h')
-rw-r--r-- | kplato/kptresource.h | 166 |
1 files changed, 83 insertions, 83 deletions
diff --git a/kplato/kptresource.h b/kplato/kptresource.h index 4d160321..be558d93 100644 --- a/kplato/kptresource.h +++ b/kplato/kptresource.h @@ -24,14 +24,14 @@ #include "kptduration.h" #include "kptdatetime.h" -#include <qdom.h> -#include <qintdict.h> -#include <qstring.h> -#include <qptrlist.h> +#include <tqdom.h> +#include <tqintdict.h> +#include <tqstring.h> +#include <tqptrlist.h> #include <kdebug.h> -class QTime; +class TQTime; namespace KPlato { @@ -70,16 +70,16 @@ class ResourceGroup { enum Type { Type_Work, Type_Material }; - QString id() const { return m_id; } - bool setId(QString id); + TQString id() const { return m_id; } + bool setId(TQString id); void generateId(); Project *project() { return m_project; } - void setName(QString n) {m_name=n;} - const QString &name() const {return m_name;} + void setName(TQString n) {m_name=n;} + const TQString &name() const {return m_name;} void setType(Type type) { m_type = type; } - //void setType(const QString &type); + //void setType(const TQString &type); Type type() const { return m_type; } /** Manage the resources in this list @@ -104,7 +104,7 @@ class ResourceGroup { * @param duration todo * @param num todo */ - QPtrList<Resource> availableResources(const DateTime start, const Duration duration, int num); + TQPtrList<Resource> availableResources(const DateTime start, const Duration duration, int num); /** Manage the dependent resources. This is a list of the resource * groups that must have available resources for this resource to * perform the work @@ -124,10 +124,10 @@ class ResourceGroup { */ void removeRequiredResource(int); int numResources() const { return m_resources.count(); } - QPtrList<Resource> &resources() { return m_resources; } + TQPtrList<Resource> &resources() { return m_resources; } - bool load(QDomElement &element); - void save(QDomElement &element) const; + bool load(TQDomElement &element); + void save(TQDomElement &element) const; void initiateCalculation(Schedule &sch); @@ -142,35 +142,35 @@ class ResourceGroup { { m_requests.append(request); } void unregisterRequest(ResourceGroupRequest *request) { m_requests.removeRef(request); } - const QPtrList<ResourceGroupRequest> &requests() const + const TQPtrList<ResourceGroupRequest> &requests() const { return m_requests; } ResourceGroup *findId() const { return findId(m_id); } - ResourceGroup *findId(const QString &id) const; + ResourceGroup *findId(const TQString &id) const; bool removeId() { return removeId(m_id); } - bool removeId(const QString &id); - void insertId(const QString &id); + bool removeId(const TQString &id); + void insertId(const TQString &id); Appointment appointmentIntervals() const; #ifndef NDEBUG - void printDebug(QString ident); + void printDebug(TQString ident); #endif private: Project *m_project; - QString m_id; // unique id - QString m_name; - QPtrList<Resource> m_resources; - QPtrList<Risk> m_risks; - QPtrList<ResourceGroup> m_requires; + TQString m_id; // unique id + TQString m_name; + TQPtrList<Resource> m_resources; + TQPtrList<Risk> m_risks; + TQPtrList<ResourceGroup> m_requires; - QPtrList<Node> m_nodes; //The nodes that want resources from us + TQPtrList<Node> m_nodes; //The nodes that want resources from us Calendar *m_defaultCalendar; Type m_type; - QPtrList<ResourceGroupRequest> m_requests; + TQPtrList<ResourceGroupRequest> m_requests; }; @@ -191,48 +191,48 @@ public: Resource(Resource *resource); virtual ~Resource(); - QString id() const { return m_id; } - bool setId(QString id); + TQString id() const { return m_id; } + bool setId(TQString id); void generateId(); enum Type { Type_Work, Type_Material }; void setType(Type type) { m_type = type; } - void setType(const QString &type); + void setType(const TQString &type); Type type() const { return m_type; } - QString typeToString() const; + TQString typeToString() const; - void setName(QString n) {m_name=n;} - const QString &name() const {return m_name;} + void setName(TQString n) {m_name=n;} + const TQString &name() const {return m_name;} - void setInitials(QString initials) {m_initials=initials;} - const QString &initials() const {return m_initials;} + void setInitials(TQString initials) {m_initials=initials;} + const TQString &initials() const {return m_initials;} - void setEmail(QString email) {m_email=email;} - const QString &email() const {return m_email;} + void setEmail(TQString email) {m_email=email;} + const TQString &email() const {return m_email;} void copy(Resource *resource); /// Set the time from when the resource is available to this project - void setAvailableFrom(const QDateTime &af) {m_availableFrom=af;} + void setAvailableFrom(const TQDateTime &af) {m_availableFrom=af;} /// Return the time when the resource is available to this project const DateTime &availableFrom() const {return m_availableFrom;} /// Set the time when the resource is no longer available to this project - void setAvailableUntil(const QDateTime au) {m_availableUntil=au;} + void setAvailableUntil(const TQDateTime au) {m_availableUntil=au;} /// Return the time when the resource is no longer available to this project. const DateTime &availableUntil() const {return m_availableUntil;} - void addWorkingHour(QTime from, QTime until); - QPtrList<QTime> workingHours() { return m_workingHours; } + void addWorkingHour(TQTime from, TQTime until); + TQPtrList<TQTime> workingHours() { return m_workingHours; } DateTime getFirstAvailableTime(DateTime after = DateTime()); DateTime getBestAvailableTime(Duration duration); DateTime getBestAvailableTime(const DateTime after, const Duration duration); - bool load(QDomElement &element); - void save(QDomElement &element) const; + bool load(TQDomElement &element); + void save(TQDomElement &element) const; ///Return the list of appointments for current schedule. - QPtrList<Appointment> appointments(); + TQPtrList<Appointment> appointments(); Appointment *findAppointment(Node *node); /// Adds appointment to current schedule @@ -247,7 +247,7 @@ public: void makeAppointment(Schedule *schedule); bool isOverbooked() const; - bool isOverbooked(const QDate &date) const; + bool isOverbooked(const TQDate &date) const; bool isOverbooked(const DateTime &start, const DateTime &end) const; double normalRate() const { return cost.normalRate; } @@ -273,7 +273,7 @@ public: * If local=false, check if there is a default calendar. */ Calendar *calendar(bool local=false) const; - Calendar *calendar(const QString id) const; + Calendar *calendar(const TQString id) const; void setCalendar(Calendar *calendar) { m_calendar = calendar; } /** @@ -283,7 +283,7 @@ public: { m_requests.append(request); } void unregisterRequest(const ResourceRequest *request) { m_requests.removeRef(request); } - const QPtrList<ResourceRequest> &requests() const + const TQPtrList<ResourceRequest> &requests() const { return m_requests; } Duration effort(const DateTime &start, const Duration &duration, bool backward, bool *ok=0) const; @@ -300,43 +300,43 @@ public: DateTime availableBefore(const DateTime &time, const DateTime limit=DateTime(), bool checkAppointments=false) const; Resource *findId() const { return findId(m_id); } - Resource *findId(const QString &id) const; + Resource *findId(const TQString &id) const; bool removeId() { return removeId(m_id); } - bool removeId(const QString &id); - void insertId(const QString &id); + bool removeId(const TQString &id); + void insertId(const TQString &id); - Calendar *findCalendar(const QString &id) const; + Calendar *findCalendar(const TQString &id) const; Appointment appointmentIntervals() const; - Duration plannedEffort(const QDate &date) const; + Duration plannedEffort(const TQDate &date) const; void setCurrentSchedule(Schedule *schedule) { m_currentSchedule = schedule; } void setCurrentSchedule(long id) { m_currentSchedule = findSchedule(id); } Schedule *currentSchedule() const { return m_currentSchedule; } - QIntDict<Schedule> &schedules() { return m_schedules; } + TQIntDict<Schedule> &schedules() { return m_schedules; } Schedule *findSchedule(long id) { return m_schedules[id]; } /// Take, and delete. void removeSchedule(Schedule *schedule); /// Take, don't delete. void takeSchedule(const Schedule *schedule); void addSchedule(Schedule *schedule); - ResourceSchedule *createSchedule(QString name, int type, long id); - ResourceSchedule *createSchedule(Schedule *parent); + ResourceSchedule *createSchedule(TQString name, int type, long id); + ResourceSchedule *createSchedule(Schedule *tqparent); protected: void makeAppointment(Schedule *node, const DateTime &from, const DateTime &end); private: Project *m_project; - QIntDict<Schedule> m_schedules; - QString m_id; // unique id - QString m_name; - QString m_initials; - QString m_email; + TQIntDict<Schedule> m_schedules; + TQString m_id; // unique id + TQString m_name; + TQString m_initials; + TQString m_email; DateTime m_availableFrom; DateTime m_availableUntil; - QPtrList<QTime> m_workingHours; + TQPtrList<TQTime> m_workingHours; int m_units; // avalable units in percent @@ -349,13 +349,13 @@ private: } cost; Calendar *m_calendar; - QPtrList<ResourceRequest> m_requests; + TQPtrList<ResourceRequest> m_requests; Schedule *m_currentSchedule; public: #ifndef NDEBUG - void printDebug(QString ident); + void printDebug(TQString ident); #endif }; @@ -394,14 +394,14 @@ class ResourceRequest { ~ResourceRequest(); - ResourceGroupRequest *parent() const { return m_parent; } - void setParent(ResourceGroupRequest *parent) { m_parent = parent; } + ResourceGroupRequest *tqparent() const { return m_parent; } + void setParent(ResourceGroupRequest *tqparent) { m_parent = tqparent; } Resource *resource() const { return m_resource; } void setResource(Resource* resource) { m_resource = resource; } - bool load(QDomElement &element, Project &project); - void save(QDomElement &element) const; + bool load(TQDomElement &element, Project &project); + void save(TQDomElement &element) const; /** * Get amount of requested resource units in percent @@ -429,7 +429,7 @@ class ResourceRequest { #ifndef NDEBUG public: - void printDebug(QString ident); + void printDebug(TQString ident); #endif }; @@ -438,18 +438,18 @@ class ResourceGroupRequest { ResourceGroupRequest(ResourceGroup *group=0, int units=0); ~ResourceGroupRequest(); - void setParent(ResourceRequestCollection *parent) { m_parent = parent;} - ResourceRequestCollection *parent() const { return m_parent; } + void setParent(ResourceRequestCollection *tqparent) { m_parent = tqparent;} + ResourceRequestCollection *tqparent() const { return m_parent; } ResourceGroup *group() const { return m_group; } - QPtrList<ResourceRequest> &resourceRequests() { return m_resourceRequests; } + TQPtrList<ResourceRequest> &resourceRequests() { return m_resourceRequests; } void addResourceRequest(ResourceRequest *request); void removeResourceRequest(ResourceRequest *request) { m_resourceRequests.removeRef(request); } ResourceRequest *takeResourceRequest(ResourceRequest *request); - ResourceRequest *find(Resource *resource) const; + ResourceRequest *tqfind(Resource *resource) const; - bool load(QDomElement &element, Project &project); - void save(QDomElement &element) const; + bool load(TQDomElement &element, Project &project); + void save(TQDomElement &element) const; /** * Get total amount of resource units in percent @@ -494,13 +494,13 @@ class ResourceGroupRequest { int m_units; ResourceRequestCollection *m_parent; - QPtrList<ResourceRequest> m_resourceRequests; + TQPtrList<ResourceRequest> m_resourceRequests; DateTime m_start; Duration m_duration; #ifndef NDEBUG public: - void printDebug(QString ident); + void printDebug(TQString ident); #endif }; @@ -509,19 +509,19 @@ public: ResourceRequestCollection(Task &task); ~ResourceRequestCollection(); - const QPtrList<ResourceGroupRequest> &requests() const { return m_requests; } + const TQPtrList<ResourceGroupRequest> &requests() const { return m_requests; } void addRequest(ResourceGroupRequest *request) { m_requests.append(request); request->setParent(this); } void removeRequest(ResourceGroupRequest *request) { m_requests.removeRef(request); } - void takeRequest(ResourceGroupRequest *request) { m_requests.take(m_requests.findRef(request)); } - ResourceGroupRequest *find(ResourceGroup *resource) const; - ResourceRequest *find(Resource *resource) const; + void takeRequest(ResourceGroupRequest *request) { m_requests.take(m_requests.tqfindRef(request)); } + ResourceGroupRequest *tqfind(ResourceGroup *resource) const; + ResourceRequest *tqfind(Resource *resource) const; bool isEmpty() const; - //bool load(QDomElement &element, Project &project); - void save(QDomElement &element) const; + //bool load(TQDomElement &element, Project &project); + void save(TQDomElement &element) const; void clear() { m_requests.clear(); } @@ -566,11 +566,11 @@ protected: private: Task &m_task; - QPtrList<ResourceGroupRequest> m_requests; + TQPtrList<ResourceGroupRequest> m_requests; #ifndef NDEBUG public: - void printDebug(QString ident); + void printDebug(TQString ident); #endif }; |