Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes

FileOpen Class Reference

Displays a "file open dialog" (sorta). More...

#include <fileopen.h>

Inheritance diagram for FileOpen:
Inheritance graph
[legend]
Collaboration diagram for FileOpen:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FileOpen (std::string t) throw (YAPET::UI::UIException)
std::string getFilepath ()
bool isCanceled () const
void refresh () throw (YAPET::UI::UIException)
void resize () throw (YAPET::UI::UIException)
void run () throw (YAPET::UI::UIException)
virtual ~FileOpen ()

Protected Member Functions

void cd (const YAPET::UI::secstring d) throw (YAPET::UI::UIException)
void getcwd () throw (YAPET::UI::UIException)
void getEntries (std::list< YAPET::UI::secstring > &d, std::list< YAPET::UI::secstring > &f) throw (YAPET::UI::UIException)

Private Types

enum  { FALLBACK_PATH_MAX = 255 }

Private Member Functions

void createWindows () throw (YAPET::UI::UIException)
 FileOpen (const FileOpen &)
const FileOpenoperator= (const FileOpen &)
void printCWD () throw (YAPET::UI::UIException)
void printTitle () throw (YAPET::UI::UIException)
int startX ()
int startY ()
int windowHeight ()
int windowWidth ()

Private Attributes

YAPET::UI::Buttoncancelbutton
bool canceled
YAPET::UI::ListWidget
< YAPET::UI::secstring > * 
dir
YAPET::UI::secstring directory
YAPET::UI::secstring filename
YAPET::UI::ListWidget
< YAPET::UI::secstring > * 
files
YAPET::UI::InputWidgetinput
YAPET::UI::Buttonokbutton
std::string title
WINDOW * window

Detailed Description

Displays a window where the user can navigate the directory hierarchy and select a file whose ending is .pet.

Note:
The filename returned by getFilepath() always ends with .pet.

Definition at line 55 of file fileopen.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
FALLBACK_PATH_MAX 

The max filename length.

This is only used if we are unable to determine the max length of the filename by other means.

Definition at line 57 of file fileopen.h.


Constructor & Destructor Documentation

FileOpen::FileOpen ( const FileOpen  )  [inline, private]

Definition at line 77 of file fileopen.h.

FileOpen::FileOpen ( std::string  t  )  throw (YAPET::UI::UIException)

Definition at line 209 of file fileopen.cc.

FileOpen::~FileOpen (  )  [virtual]

Definition at line 222 of file fileopen.cc.

References cancelbutton, dir, files, input, okbutton, and window.


Member Function Documentation

void FileOpen::cd ( const YAPET::UI::secstring  d  )  throw (YAPET::UI::UIException) [protected]

Definition at line 200 of file fileopen.cc.

Referenced by run().

Here is the caller graph for this function:

void FileOpen::createWindows (  )  throw (YAPET::UI::UIException) [private]

Definition at line 78 of file fileopen.cc.

References cancelbutton, dir, files, getEntries(), input, okbutton, startX(), startY(), window, windowHeight(), and windowWidth().

Referenced by resize().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileOpen::getcwd (  )  throw (YAPET::UI::UIException) [protected]

Definition at line 175 of file fileopen.cc.

References directory, and FALLBACK_PATH_MAX.

void FileOpen::getEntries ( std::list< YAPET::UI::secstring > &  d,
std::list< YAPET::UI::secstring > &  f 
) throw (YAPET::UI::UIException) [protected]

Definition at line 113 of file fileopen.cc.

References endswith(), and YAPET::CONSTS::Consts::getDefaultSuffix().

Referenced by createWindows(), and run().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string FileOpen::getFilepath (  ) 

Definition at line 389 of file fileopen.cc.

References directory, endswith(), filename, and YAPET::CONSTS::Consts::getDefaultSuffix().

Referenced by MainWindow::run().

Here is the call graph for this function:

Here is the caller graph for this function:

bool FileOpen::isCanceled (  )  const [inline]

Definition at line 126 of file fileopen.h.

References canceled, and filename.

Referenced by MainWindow::run().

Here is the caller graph for this function:

const FileOpen& FileOpen::operator= ( const FileOpen  )  [inline, private]

Definition at line 78 of file fileopen.h.

void FileOpen::printCWD (  )  throw (YAPET::UI::UIException) [private]

Definition at line 155 of file fileopen.cc.

References directory, window, and windowWidth().

Referenced by refresh(), and run().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileOpen::printTitle (  )  throw (YAPET::UI::UIException) [private]

Definition at line 147 of file fileopen.cc.

References title, and window.

Referenced by refresh().

Here is the caller graph for this function:

void FileOpen::refresh (  )  throw (YAPET::UI::UIException) [virtual]

Implements YAPET::UI::BaseWindow.

Definition at line 346 of file fileopen.cc.

References box(), cancelbutton, dir, files, input, YAPET::UI::MESSAGEBOX, okbutton, printCWD(), printTitle(), YAPET::UI::Button::refresh(), YAPET::UI::InputWidget::refresh(), YAPET::UI::ListWidget< T >::refresh(), YAPET::UI::Colors::setcolor(), and window.

Referenced by run().

Here is the call graph for this function:

Here is the caller graph for this function:

void FileOpen::resize (  )  throw (YAPET::UI::UIException) [virtual]

Implements YAPET::UI::BaseWindow.

Definition at line 368 of file fileopen.cc.

References cancelbutton, createWindows(), dir, files, input, okbutton, and window.

Here is the call graph for this function:

void FileOpen::run (  )  throw (YAPET::UI::UIException)
int FileOpen::startX (  )  [inline, private]

Definition at line 93 of file fileopen.h.

References YAPET::UI::BaseWindow::minX().

Referenced by createWindows().

Here is the call graph for this function:

Here is the caller graph for this function:

int FileOpen::startY (  )  [inline, private]

Definition at line 97 of file fileopen.h.

References YAPET::UI::BaseWindow::minY().

Referenced by createWindows().

Here is the call graph for this function:

Here is the caller graph for this function:

int FileOpen::windowHeight (  )  [inline, private]

Definition at line 89 of file fileopen.h.

References YAPET::UI::BaseWindow::maxY().

Referenced by createWindows().

Here is the call graph for this function:

Here is the caller graph for this function:

int FileOpen::windowWidth (  )  [inline, private]

Definition at line 85 of file fileopen.h.

References YAPET::UI::BaseWindow::maxX().

Referenced by createWindows(), and printCWD().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 73 of file fileopen.h.

Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().

bool FileOpen::canceled [private]

Definition at line 75 of file fileopen.h.

Referenced by isCanceled(), and run().

Definition at line 69 of file fileopen.h.

Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().

Definition at line 82 of file fileopen.h.

Referenced by getcwd(), getFilepath(), and printCWD().

Definition at line 83 of file fileopen.h.

Referenced by getFilepath(), isCanceled(), and run().

Definition at line 70 of file fileopen.h.

Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().

Definition at line 71 of file fileopen.h.

Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().

Definition at line 72 of file fileopen.h.

Referenced by createWindows(), refresh(), resize(), run(), and ~FileOpen().

std::string FileOpen::title [private]

Definition at line 67 of file fileopen.h.

Referenced by printTitle().

WINDOW* FileOpen::window [private]

Definition at line 68 of file fileopen.h.

Referenced by createWindows(), printCWD(), printTitle(), refresh(), resize(), and ~FileOpen().


The documentation for this class was generated from the following files: