• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

keduca

FileRead Class Reference

File Read operations. More...

#include <fileread.h>

Inheritance diagram for FileRead:

Inheritance graph
[legend]

List of all members.


Public Types

enum  AnswerField { AF_TEXT, AF_VALUE, AF_POINT }
enum  QuestionField {
  QF_TEXT, QF_PICTURE, QF_POINTS, QF_TYPE,
  QF_TIME, QF_TIP, QF_EXPLAIN
}
enum  ResultField { RS_TEXT, RS_MIN, RS_MAX, RS_PICTURE }

Signals

void canceled (const QString &errMsg)
void completed (bool pendingAction)
void completed ()
void setWindowCaption (const QString &caption)

Public Member Functions

bool changed ()
void clearAnswers ()
 FileRead (QObject *parent=0, const char *name=0)
QString getAnswer (AnswerField field)
int getAnswerPoints ()
bool getAnswerValue ()
KURL const & getCurrentURL () const
QString getHeader (const QString &head)
QString getPicture ()
QPixmap getPicturePixmap ()
QString getQuestion (QuestionField field)
int getQuestionInt (QuestionField field)
QString getResult (ResultField field)
int getResultInt (ResultField field)
uint getTotalPoints ()
uint getTotalQuestions ()
uint getTotalTime ()
void insertQuestion ()
void insertResult ()
bool isMultiAnswer ()
bool isResult ()
bool openFile (const KURL &url)
void recordAnswerAt (unsigned int index)
bool recordAnswerBOF ()
unsigned int recordAnswerCount ()
bool recordAnswerEOF ()
void recordAnswerFirst ()
void recordAnswerLast ()
void recordAnswerNext ()
void recordAnswerPrevious ()
void recordAt (uint index)
bool recordBOF ()
void recordDelete ()
bool recordEOF ()
void recordFirst ()
void recordLast ()
void recordNext ()
void recordPrevious ()
bool recordResultBOF ()
bool recordResultEOF ()
void recordResultFirst ()
void recordResultLast ()
void recordResultNext ()
void recordResultPrevious ()
void recordSwap (bool)
void refreshData ()
bool saveFile (const KURL &url=KURL(), bool copyimages=false, bool saveCompressed=true)
bool saveResults (const KURL &url, const QString &results)
void setAnswer (const QString &text, bool value, int points=0)
void setHeader (const QString field, const QString value)
void setQuestion (QuestionField field, int value)
void setQuestion (QuestionField field, const QString &text)
void setResult (ResultField field, int value)
void setResult (ResultField field, const QString &text)
virtual ~FileRead ()

Protected Slots

void slotUploadFinished (KIO::Job *job)

Protected Member Functions

bool loadFile (const QString &filename)
bool saveFile (const QString &filename, bool copyimages, bool saveCompressed=true)
bool saveResults (const QString &filename, const QString &results)

Detailed Description

File Read operations.

This class read a keduca file an pass the records.

Author:
Javier Campos

Klas Kalass

Definition at line 35 of file fileread.h.


Member Enumeration Documentation

enum FileRead::AnswerField

Enumerator:
AF_TEXT 
AF_VALUE 
AF_POINT 

Definition at line 42 of file fileread.h.

enum FileRead::QuestionField

Enumerator:
QF_TEXT 
QF_PICTURE 
QF_POINTS 
QF_TYPE 
QF_TIME 
QF_TIP 
QF_EXPLAIN 

Definition at line 41 of file fileread.h.

enum FileRead::ResultField

Enumerator:
RS_TEXT 
RS_MIN 
RS_MAX 
RS_PICTURE 

Definition at line 43 of file fileread.h.


Constructor & Destructor Documentation

FileRead::FileRead ( QObject *  parent = 0,
const char *  name = 0 
)

Definition at line 32 of file fileread.cpp.

FileRead::~FileRead (  )  [virtual]

Definition at line 39 of file fileread.cpp.


Member Function Documentation

void FileRead::canceled ( const QString &  errMsg  )  [signal]

Emit this if loading is canceled by the user or by an error.

bool FileRead::changed (  )  [inline]

Returns:
true: The document has changed and should be saved

Definition at line 139 of file fileread.h.

void FileRead::clearAnswers (  ) 

Clear answers.

Definition at line 602 of file fileread.cpp.

void FileRead::completed ( bool  pendingAction  )  [signal]

Same as the above signal except besides indicating that the data has been completely loaded it also informs the host, by setting the flag, that a pending action has been generated as a result of completing the requested task (loading the data).

An example of this is meta-refresh tags on HTML pages which result in the page either being refreshed or the viewer being redirected to another page. By emitting this signal after appropriately setting the flag, the part can tell the host of the pending scheduled action inorder to give it a chance to accept or cancel that action.

pendingAction if true, a pending action exists (ex: a scheduled refresh)

void FileRead::completed (  )  [signal]

Emit this when you have completed loading data.

Hosting apps will want to know when the process of loading the data is finished, so that they can access the data when everything is loaded.

QString FileRead::getAnswer ( AnswerField  field  ) 

Get Answer field.

Definition at line 458 of file fileread.cpp.

int FileRead::getAnswerPoints (  ) 

Get answer field.

Definition at line 483 of file fileread.cpp.

bool FileRead::getAnswerValue (  ) 

Get Answer field.

Definition at line 478 of file fileread.cpp.

KURL const& FileRead::getCurrentURL (  )  const [inline]

Definition at line 137 of file fileread.h.

QString FileRead::getHeader ( const QString &  head  ) 

Get Header.

Definition at line 895 of file fileread.cpp.

QString FileRead::getPicture (  ) 

Get real picture.

Definition at line 558 of file fileread.cpp.

QPixmap FileRead::getPicturePixmap (  ) 

Get real picture.

Definition at line 581 of file fileread.cpp.

QString FileRead::getQuestion ( QuestionField  field  ) 

Get the value of the field question.

Definition at line 408 of file fileread.cpp.

int FileRead::getQuestionInt ( QuestionField  field  ) 

Get the value of the field questions in integer.

Definition at line 439 of file fileread.cpp.

QString FileRead::getResult ( ResultField  field  ) 

Get the value of the field result.

Definition at line 488 of file fileread.cpp.

int FileRead::getResultInt ( ResultField  field  ) 

Get the value of the field result.

Definition at line 511 of file fileread.cpp.

uint FileRead::getTotalPoints (  ) 

Total points.

Definition at line 971 of file fileread.cpp.

uint FileRead::getTotalQuestions (  ) 

Total questions.

Definition at line 965 of file fileread.cpp.

uint FileRead::getTotalTime (  ) 

Total time.

Definition at line 977 of file fileread.cpp.

void FileRead::insertQuestion (  ) 

Insert a blank question.

Definition at line 256 of file fileread.cpp.

void FileRead::insertResult (  ) 

Insert a blank result.

Definition at line 265 of file fileread.cpp.

bool FileRead::isMultiAnswer (  ) 

is Multi Answer

Definition at line 912 of file fileread.cpp.

bool FileRead::isResult (  ) 

is Result

is Multi Answer

Definition at line 932 of file fileread.cpp.

bool FileRead::loadFile ( const QString &  filename  )  [protected]

Open keduca file.

This function does the actual work and expects a local filename .

Definition at line 61 of file fileread.cpp.

bool FileRead::openFile ( const KURL &  url  ) 

Open keduca file.

This function can open a remote or local url.

Definition at line 43 of file fileread.cpp.

void FileRead::recordAnswerAt ( unsigned int  index  ) 

Move to record.

Definition at line 396 of file fileread.cpp.

bool FileRead::recordAnswerBOF (  ) 

Returns if this record is a begin of file.

Definition at line 553 of file fileread.cpp.

unsigned int FileRead::recordAnswerCount (  ) 

Record answer count.

Definition at line 403 of file fileread.cpp.

bool FileRead::recordAnswerEOF (  ) 

Returns if this record is a end of file.

Definition at line 548 of file fileread.cpp.

void FileRead::recordAnswerFirst (  ) 

Go to the First record.

Definition at line 354 of file fileread.cpp.

void FileRead::recordAnswerLast (  ) 

Go to the Last Record.

Definition at line 361 of file fileread.cpp.

void FileRead::recordAnswerNext (  ) 

Record Next.

Definition at line 369 of file fileread.cpp.

void FileRead::recordAnswerPrevious (  ) 

Record previous.

Definition at line 383 of file fileread.cpp.

void FileRead::recordAt ( uint  index  ) 

Record at index.

Definition at line 957 of file fileread.cpp.

bool FileRead::recordBOF (  ) 

Returns if this record is a begin of file.

Definition at line 533 of file fileread.cpp.

void FileRead::recordDelete (  ) 

Delete current record.

Definition at line 608 of file fileread.cpp.

bool FileRead::recordEOF (  ) 

Returns if this record is a end of file.

Definition at line 528 of file fileread.cpp.

void FileRead::recordFirst (  ) 

Go to the First record.

Definition at line 274 of file fileread.cpp.

void FileRead::recordLast (  ) 

Go to the Last Record.

Definition at line 281 of file fileread.cpp.

void FileRead::recordNext (  ) 

Record Next.

Definition at line 289 of file fileread.cpp.

void FileRead::recordPrevious (  ) 

Record previous.

Definition at line 301 of file fileread.cpp.

bool FileRead::recordResultBOF (  ) 

Returns if this record is a begin of file.

Definition at line 543 of file fileread.cpp.

bool FileRead::recordResultEOF (  ) 

Returns if this record is a end of file.

Definition at line 538 of file fileread.cpp.

void FileRead::recordResultFirst (  ) 

Go to the First record.

Definition at line 312 of file fileread.cpp.

void FileRead::recordResultLast (  ) 

Go to the Last Record.

Definition at line 319 of file fileread.cpp.

void FileRead::recordResultNext (  ) 

Record Next.

Definition at line 327 of file fileread.cpp.

void FileRead::recordResultPrevious (  ) 

Record previous.

Definition at line 341 of file fileread.cpp.

void FileRead::recordSwap ( bool  moveup  ) 

Swap two variables.

Definition at line 614 of file fileread.cpp.

void FileRead::refreshData (  ) 

Refresh stadistical data - Points, number questions and total points.

Definition at line 983 of file fileread.cpp.

bool FileRead::saveFile ( const QString &  filename,
bool  copyimages,
bool  saveCompressed = true 
) [protected]

Save KEduca file to the file.

Definition at line 682 of file fileread.cpp.

bool FileRead::saveFile ( const KURL &  url = KURL(),
bool  copyimages = false,
bool  saveCompressed = true 
)

Save file.

Definition at line 640 of file fileread.cpp.

bool FileRead::saveResults ( const QString &  filename,
const QString &  results 
) [protected]

Save Results file to the file.

Definition at line 859 of file fileread.cpp.

bool FileRead::saveResults ( const KURL &  url,
const QString &  results 
)

Save results.

Definition at line 817 of file fileread.cpp.

void FileRead::setAnswer ( const QString &  text,
bool  value,
int  points = 0 
)

Insert an answer field.

Definition at line 244 of file fileread.cpp.

void FileRead::setHeader ( const QString  field,
const QString  value 
)

Set header data.

Definition at line 901 of file fileread.cpp.

void FileRead::setQuestion ( QuestionField  field,
int  value 
)

Set value to questions fields.

Definition at line 189 of file fileread.cpp.

void FileRead::setQuestion ( QuestionField  field,
const QString &  text 
)

Set value to questions fields.

Definition at line 165 of file fileread.cpp.

void FileRead::setResult ( ResultField  field,
int  value 
)

Set value to results fields.

Definition at line 227 of file fileread.cpp.

void FileRead::setResult ( ResultField  field,
const QString &  text 
)

Set value to results fields.

Definition at line 209 of file fileread.cpp.

void FileRead::setWindowCaption ( const QString &  caption  )  [signal]

Emitted by the part, to set the caption of the window(s) hosting this part.

void FileRead::slotUploadFinished ( KIO::Job *  job  )  [protected, slot]

Definition at line 937 of file fileread.cpp.


The documentation for this class was generated from the following files:
  • fileread.h
  • fileread.cpp

keduca

Skip menu "keduca"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal