Source: resourcefile.h


Annotated List
Files
Globals
Hierarchy
Index
#ifndef KABC_RESOURCEFILE_H
#define KABC_RESOURCEFILE_H

#include 

#include "resource.h"

class QTimer;

namespace KABC {

class Format;

/**
  @internal
*/
class ResourceFile : public QObject, public Resource {
    Q_OBJECT
  public:
    ResourceFile( AddressBook *, const QString &filename, Format *format=0 );
    ~ResourceFile();
  
    bool open();
    void close();
  
    Ticket *requestSaveTicket();

    bool load( AddressBook * );
    bool save( Ticket * );

    /**
      Set name of file to be used for saving.
    */
    void setFileName( const QString & );
    /**
      Return name of file used for loading and saving the address book.
    */
    QString fileName() const;

  protected slots:
    void checkFile();

  protected:
    bool lock( const QString &fileName );
    void unlock( const QString &fileName );


  private:
    QString mFileName;
    Format *mFormat;

    QString mLockUniqueName;
    
    QTimer *mFileCheckTimer;
    time_t mChangeTime;
};

}

#endif

Generated by: root on bugs.devel.redhat.com on Wed Nov 13 08:38:23 2002, using kdoc 2.0a54.