Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

qhttpsession.h

00001 // -*- c++ -*-
00002 
00003 #ifndef QHTTPSESSION_H
00004 #define QHTTPSESSION_H
00005 
00006 #include <qdatetime.h>
00007 #include <qmap.h>
00008 #include <qstringlist.h>
00009 #include <qvariant.h>
00010 
00016 class QHttpSession
00017 {
00018 public: 
00019    QHttpSession();
00020    ~QHttpSession();
00021    
00023    void invalidate();
00024 
00026    bool isNew() const { return isnew; }
00027 
00029    void setNew( bool isnew=false ) { this->isnew = isnew; }
00030   
00032    QDateTime creationTime() const { return created; }
00033 
00035    QString id() const { return sessid; }
00036 
00041    void setLastAccessTime( const QDateTime &dt = QDateTime() );
00042    
00044    QDateTime lastAccessedTime() const { return accessed; }
00045 
00047    int maxInactiveInterval() const { return maxinactive; }
00048 
00050    void setMaxInactiveInterval( int interval ) { maxinactive = interval; }
00051 
00052    //
00053    // Value handling
00054    //
00055    
00057    QVariant value( const QString &name ) const { return vals[name]; }
00058 
00060    QStringList valueNames() const { return valnames; }
00061 
00063    void setValue( const QString &name, const QVariant &value );
00064 
00066    void removeValue( const QString &name ) { valnames.remove(name); vals.remove(name); }
00067       
00068 private:
00069    QDateTime created;
00070    QDateTime accessed;
00071    QString sessid;
00072    int maxinactive;
00073    QStringList valnames;
00074    QMap<QString, QVariant> vals;
00075    bool isnew;
00076 
00077    struct QHttpSessionPrivate *d;
00078 };
00079 
00080 #endif
00081 
00082 // Local Variables:
00083 // c-basic-offset: 3
00084 // End:

Generated on Wed Apr 9 23:50:21 2003 for QXServlet by doxygen1.2.17