Commit 6f863666 authored by kocienda's avatar kocienda

First pass at code cleanup: Added constructors, copy constructors,

destructors, assignment operators, etc.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 296fd293
......@@ -26,19 +26,46 @@
#ifndef QAPPLICATION_H_
#define QAPPLICATION_H_
#include "qpalette.h"
#include "qwidget.h"
#include "qpalette.h"
#include "qsize.h"
// class QApplication ==========================================================
class QApplication {
public:
static QPalette palette(const QWidget* = 0);
// typedefs ----------------------------------------------------------------
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
static QPalette palette(const QWidget *p=0);
static QWidget *desktop();
static int startDragDistance();
static QSize globalStrut();
static void setOverrideCursor(const QCursor &);
static void restoreOverrideCursor();
static bool sendEvent(QObject *receiver, QEvent *event);
};
static bool sendEvent(QObject *, QEvent *);
// constructors, copy constructors, and destructors ------------------------
QApplication();
virtual ~QApplication();
// member functions --------------------------------------------------------
// operators ---------------------------------------------------------------
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
private:
// no copying or assignment
QApplication(const QApplication &);
QApplication &operator=(const QApplication &);
}; // class QApplication =======================================================
#endif
......@@ -28,20 +28,74 @@
#include <KWQDef.h>
class QAsynchIO {
// class QAsyncIO ==============================================================
class QAsyncIO {
// Note : all class members in protected scope
protected:
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
virtual ~QAsyncIO();
// member functions --------------------------------------------------------
void ready();
};
class QDataSource : public QAsynchIO {
// operators ---------------------------------------------------------------
// private ---------------------------------------------------------------------
}; // class QAsyncIO ===========================================================
// class QDataSource ===========================================================
class QDataSource : public QAsyncIO {
public:
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
// member functions --------------------------------------------------------
virtual void rewind();
void maybeReady();
};
class QDataSink : public QAsynchIO {
// operators ---------------------------------------------------------------
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
}; // end class QDataSource ====================================================
// class QDataSink =============================================================
class QDataSink : public QAsyncIO {
public:
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
// member functions --------------------------------------------------------
virtual void receive(const uchar*, int count)=0;
};
// operators ---------------------------------------------------------------
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
}; // class QDataSink ==========================================================
#endif
......@@ -29,11 +29,38 @@
#include "qcolor.h"
#include "qnamespace.h"
// class QBrush ================================================================
class QBrush : public Qt {
friend class QPainter;
public:
// typedefs ----------------------------------------------------------------
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
QBrush();
QBrush(const QColor &);
};
QBrush(const QBrush &);
QBrush &operator=(const QBrush &);
~QBrush();
// member functions --------------------------------------------------------
// operators ---------------------------------------------------------------
bool operator==(const QBrush &) const;
bool operator!=(const QBrush &) const;
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
}; // class QBrush =============================================================
#endif
......@@ -28,17 +28,44 @@
#include <KWQDef.h>
#include "qarray.h"
#include "qstring.h"
// class QBuffer ===============================================================
class QBuffer {
public:
QByteArray buffer() const;
// typedefs ----------------------------------------------------------------
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
QBuffer();
~QBuffer();
// member functions --------------------------------------------------------
QByteArray buffer() const;
uint size() const;
bool isOpen();
bool open(int);
void close();
int writeBlock(const char *, uint);
};
// operators ---------------------------------------------------------------
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
private:
// no copying or assignment
QBuffer(const QBuffer &);
QBuffer &operator=(const QBuffer &);
}; // class QBuffer ============================================================
#endif
......@@ -27,16 +27,40 @@
#define QBUTTON_H_
#include "qwidget.h"
class QString;
#include "qstring.h"
// class QButton ===============================================================
class QButton : public QWidget {
public:
// typedefs ----------------------------------------------------------------
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
QButton();
QButton(QWidget *);
virtual ~QButton();
// member functions --------------------------------------------------------
virtual void setText(const QString &);
QString text() const;
};
// operators ---------------------------------------------------------------
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
private:
// no copying or assignment
QButton(const QButton &);
QButton &operator=(const QButton &);
}; // class QButton ============================================================
#endif
......@@ -36,31 +36,50 @@
typedef QArray<char> QByteArray;
// added to help in compilation of khtml/dom/html_documnent.cpp:182
// class QCString ==============================================================
class QCString : public QByteArray {
public:
// typedefs ----------------------------------------------------------------
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
QCString();
QCString(int);
QCString(const char *);
QCString(const char *, uint);
QCString(const QCString&);
QCString mid(uint index, uint len=0xffffffff) const;
int find(const char *str, int index=0, bool cs=TRUE) const;
int contains(char) const;
// member functions --------------------------------------------------------
bool isEmpty() const;
bool isNull() const;
int find(const char *str, int index=0, bool cs=TRUE) const;
int contains(char) const;
uint length() const;
bool truncate(uint);
QCString lower() const;
QCString mid(uint index, uint len=0xffffffff) const;
// operators ---------------------------------------------------------------
operator const char *() const;
QCString &operator=(const QCString&);
QCString &operator=(const char *);
QCString &operator+=(const char *);
QCString &operator+=(const QCString&);
};
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
}; // class QCString ===========================================================
// operators associated with QCString ==========================================
bool operator==(const char *, const QCString &);
bool operator==(const QCString &, const char *);
......
......@@ -28,12 +28,35 @@
#include <KWQButton.h>
// class QCheckBox =============================================================
class QCheckBox : public QButton {
public:
// typedefs ----------------------------------------------------------------
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
QCheckBox();
QCheckBox(QWidget *parent);
QCheckBox(QWidget *);
// member functions --------------------------------------------------------
void setChecked(bool);
};
// operators ---------------------------------------------------------------
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
private:
QCheckBox(const QCheckBox &);
QCheckBox &operator=(const QCheckBox &);
}; // class QCheckBox ==========================================================
#endif
......@@ -28,18 +28,33 @@
#include "qstring.h"
// class QColor ================================================================
class QColor {
public:
// typedefs ----------------------------------------------------------------
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
QColor();
QColor(int,int,int);
QColor(const char *);
QColor(const QColor &);
// member functions --------------------------------------------------------
QString name() const;
void setNamedColor(const QString&);
bool isValid() const;
int red() const;
int green() const;
int blue() const;
bool isValid() const;
void setRgb(int,int,int);
void setRgb(int);
......@@ -48,10 +63,15 @@ public:
QColor light(int f = 150) const;
QColor dark(int f = 200) const;
// operators ---------------------------------------------------------------
QColor &operator=(const QColor &);
bool operator==(const QColor &x) const;
bool operator!=(const QColor &x) const;
};
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
}; // class QColor =============================================================
#endif
......@@ -29,10 +29,24 @@
#include <KWQListBox.h>
#include "qwidget.h"
// class QComboBox =============================================================
class QComboBox : public QWidget {
public:
// typedefs ----------------------------------------------------------------
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
QComboBox(QWidget *parent=0, const char *name=0);
QComboBox(bool rw, QWidget *parent=0, const char *name=0);
~QComboBox();
// member functions --------------------------------------------------------
int count() const;
QListBox *listBox() const;
......@@ -41,6 +55,18 @@ public:
void insertItem(const QString &text, int index=-1);
void clear();
virtual void setCurrentItem(int);
};
// operators ---------------------------------------------------------------
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
private:
// no copying or assignment
QComboBox(const QComboBox &);
QComboBox &operator=(const QComboBox &);
}; // class QComboBox ==========================================================
#endif
......@@ -26,7 +26,33 @@
#ifndef QCURSOR_H
#define QCURSOR_H
// class QCursor ===============================================================
class QCursor {
};
public:
// typedefs ----------------------------------------------------------------
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
QCursor();
QCursor(const QCursor &);
~QCursor();
// member functions --------------------------------------------------------
// operators ---------------------------------------------------------------
QCursor &operator=(const QCursor &);
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
}; // class QCursor ============================================================
#endif
......@@ -26,32 +26,96 @@
#ifndef QDATETIME_H_
#define QDATETIME_H_
// class QTime =================================================================
class QTime {
public:
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
QTime();
QTime(int h, int m);
QTime(const QTime &other);
QTime(int, int);
QTime(const QTime &);
// member functions --------------------------------------------------------
bool isNull() const;
void start();
int msec() const;
int elapsed() const;
};
// operators ---------------------------------------------------------------
QTime &operator=(const QTime &);
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
}; // class QTime ==============================================================
// class QDate =================================================================
class QDate {
public:
// typedefs ----------------------------------------------------------------
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
// constructors, copy constructors, and destructors ------------------------
QDate(int y, int m, int d);
};
QDate(const QDate &);
// member functions --------------------------------------------------------
// operators ---------------------------------------------------------------
QDate &operator=(const QDate &);
// protected -------------------------------------------------------------------
// private ---------------------------------------------------------------------
}; // class QDate ==============================================================
// class QDateTime =============================================================
class QDateTime {
public:
// enums -------------------------------------------------------------------
// constants ---------------------------------------------------------------
// static member functions -------------------------------------------------
static QDateTime currentDateTime();
// constructors, copy constructors, and destructors ------------------------
QDateTime();
QDateTime(QDate date, QTime time);
static QDateTime currentDateTime();
QDateTime(const QDateTime &);
// member functions --------------------------------------------------------
int secsTo(const QDateTime &) const;
QTime time() const;
};
// operators ---------------------------------------------------------------
QDateTime &operator=(const QDateTime &);