Maemomm Reference Documentation: hildon-fmmm

Main Page Namespaces Book

# Hildon::FileSystemModel Class Reference
[FileSystem]

Inheritance diagram for Hildon::FileSystemModel:

List of all members.

## Detailed Description

A tree model that contains file system data.

## Public Member Functions
Glib::ustring | autoname_uri (const Glib::ustring& uri, std::auto_ptr<Glib::Error>& error) const
| This function checks if the given URI already exists in the model.
const HildonFileSystemModel* | gobj () const
| Provides access to the underlying C GObject.
HildonFileSystemModel* | gobj ()
| Provides access to the underlying C GObject.
HildonFileSystemModel* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Gtk::TreeModel::iterator | load_local_path (const std::string& path)
| Loads a local path.
Gtk::TreeModel::iterator | load_path (const std::string& path)
| This method locates the given path from the data model.
Gtk::TreeModel::iterator | load_uri (const Glib::ustring& uri)
| Loads a URI.
Glib::ustring | new_item (const Gtk::TreeModel::iterator& parent, const Glib::ustring& stub_name, const Glib::ustring& extension)
| Creates a new unique name under parent .
void | reset_available ()
| Cancels all changes made by set_iter_available.
Gtk::TreeModel::iterator | search_local_path (const std::string& path, const Gtk::TreeModel::iterator& start_iter, bool recursive=true) const
| Searches the model for the given local path and returns an iterator pointing to it.
Gtk::TreeModel::iterator | search_local_path (const std::string& path, bool recursive=true) const
| Searches the model for the given local path and returns an iterator pointing to it.
Gtk::TreeModel::iterator | search_path (const std::string& path, const Gtk::TreeModel::iterator& start_iter, bool recursive=true) const
| Searches the model for given path and returns an iterator pointing to it.
Gtk::TreeModel::iterator | search_path (const std::string& path, bool recursive=true) const
| Searches the model for given path and returns an iterator pointing to it.
Gtk::TreeModel::iterator | search_uri (const Glib::ustring& uri, const Gtk::TreeModel::iterator& start_iter, bool recursive=true) const
| Searches the model for the given URI and returns an iterator pointing to it.
Gtk::TreeModel::iterator | search_uri (const Glib::ustring& uri, bool recursive=true) const
| Searches the model for the given URI and returns an iterator pointing to it.
void | set_iter_available (const Gtk::TreeModel::iterator& iter, bool available)
| This function sets some paths available/not available.
Glib::SignalProxy1< void, const Gtk::TreeModel::iterator& > | signal_device_disconnected ()
| Prototype: `void device_disconnected(const Gtk::TreeModel::iterator& iter)`
Glib::SignalProxy1< void, const Gtk::TreeModel::iterator& > | signal_finished_loading ()
| Prototype: `void finished_loading(const Gtk::TreeModel::iterator& iter)`
virtual | ~FileSystemModel ()
## Static Public Member Functions
static Glib::RefPtr<FileSystemModel> | create (Gtk::Widget& ref_widget)
## Protected Member Functions
| FileSystemModel (Gtk::Widget& ref_widget)
## Related Functions
(Note that these are not member functions.)
Glib::RefPtr<Hildon::FileSystemModel> | wrap (HildonFileSystemModel* object, bool take_copy=false)
  | Parameters:
  | object | The C instance

## Constructor & Destructor Documentation

virtual Hildon::FileSystemModel::~FileSystemModel | ( |  | ) | `[virtual]`

Hildon::FileSystemModel::FileSystemModel | ( | Gtk::Widget & | ref_widget | ) | `[explicit, protected]`

## Member Function Documentation

Glib::ustring Hildon::FileSystemModel::autoname_uri | ( | const Glib::ustring & | uri,
|  | std::auto_ptr< Glib::Error > & | error |
| ) |  |  | const

This function checks if the given URI already exists in the model.

if not, then a copy of it is returned unmodified. If the URI already exists then a number is added in a form file://file(2).html.

Parameters:

  | uri | An URI to be autonamed.
  | error | A GError to hold possible error information.

Returns:
  Either the same uri given as parameter or a modified uri that contains proper index number. Can be empty in case an error occured.

static Glib::RefPtr<FileSystemModel> Hildon::FileSystemModel::create | ( | Gtk::Widget & | ref_widget | ) | `[static]`

const HildonFileSystemModel* Hildon::FileSystemModel::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gtk::TreeDragSource.

HildonFileSystemModel* Hildon::FileSystemModel::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gtk::TreeDragSource.

HildonFileSystemModel* Hildon::FileSystemModel::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Gtk::TreeModel::iterator Hildon::FileSystemModel::load_local_path | ( | const std::string & | path | ) |

Loads a local path.

Parameters:

  | path | A path to load.

Returns:
  A valid iterator to the desired file, or an invalid iterator if the file was not loaded.

Gtk::TreeModel::iterator Hildon::FileSystemModel::load_path | ( | const std::string & | path | ) |

This method locates the given path from the data model.

New branches are loaded if the given path doesn't exist in memory. This method is otherwise similar to search_path().

Parameters:

  | path | A file path to load.

Returns:
  A valid iterator to the desired file, or an invalid iterator if the file was not loaded.

Gtk::TreeModel::iterator Hildon::FileSystemModel::load_uri | ( | const Glib::ustring & | uri | ) |

Loads a URI.

Parameters:

  | uri | A URI to load.

Returns:
  A valid iterator to the desired file, or an invalid iterator if the file was not loaded.

Glib::ustring Hildon::FileSystemModel::new_item | ( | const Gtk::TreeModel::iterator & | parent,
|  | const Glib::ustring & | stub_name,
|  | const Glib::ustring & | extension |
| ) |  |  |

Creates a new unique name under parent .

The returned name can be used when creating a new file. If there are no name collisions, stub name will be the final name. If a file with that name already exists, then a number is appended to stub. This function is mainly used by dialog implementations. It's probably not needed in application development.

Parameters:

  | parent | A parent iterator.
  | stub_name | A boby of the new name.
  | extension | Extension of the new name.

Returns:
  A New unique name. Can be empty if the directory is not yet loaded.

void Hildon::FileSystemModel::reset_available | ( |  | ) |

Cancels all changes made by set_iter_available.

Selection is back to it's default state.

Gtk::TreeModel::iterator Hildon::FileSystemModel::search_local_path | ( | const std::string & | path,
|  | const Gtk::TreeModel::iterator & | start_iter,
|  | bool | recursive = `true` |
| ) |  |  | const

Searches the model for the given local path and returns an iterator pointing to it.

Note that the path must already exist in the model.

Parameters:

  | path | a file path to load.
  | start_iter | An iterator indicating the starting point.
  | recursive | if false, only immediate children of the parent are searched. If true, this searches the entire subtree.

Returns:
  A valid iterator to the desired file, or an invalid iterator if the file was not found.

Gtk::TreeModel::iterator Hildon::FileSystemModel::search_local_path | ( | const std::string & | path,
|  | bool | recursive = `true` |
| ) |  |  | const

Searches the model for the given local path and returns an iterator pointing to it.

Note that the path must already exist in the model.

Parameters:

  | path | a file path to load.t.
  | recursive | if false, only immediate children of the parent are searched. If true, this searches the entire subtree.

Returns:
  A valid iterator to the desired file, or an invalid iterator if the file was not found.

Gtk::TreeModel::iterator Hildon::FileSystemModel::search_path | ( | const std::string & | path,
|  | const Gtk::TreeModel::iterator & | start_iter,
|  | bool | recursive = `true` |
| ) |  |  | const

Searches the model for given path and returns an iterator pointing to it.

Note that the path must already exist in the model.

Parameters:

  | path | A file path to load.
  | start_iter | An iterator indicating the starting point.
  | recursive | if false, only immediate children of the parent are searched. If true, this searches the entire subtree.

Returns:
  A valid iterator to the desired file, or an invalid iterator if the file was not found.

Gtk::TreeModel::iterator Hildon::FileSystemModel::search_path | ( | const std::string & | path,
|  | bool | recursive = `true` |
| ) |  |  | const

Searches the model for given path and returns an iterator pointing to it.

Note that the path must already exist in the model.

Parameters:

  | path | A file path to load.
  | recursive | if false, only immediate children of the parent are searched. If true, this searches the entire subtree.

Returns:
  A valid iterator to the desired file, or an invalid iterator if the file was not found.

Gtk::TreeModel::iterator Hildon::FileSystemModel::search_uri | ( | const Glib::ustring & | uri,
|  | const Gtk::TreeModel::iterator & | start_iter,
|  | bool | recursive = `true` |
| ) |  |  | const

Searches the model for the given URI and returns an iterator pointing to it.

Note that the path must already exist in the model.

Parameters:

  | uri | a URI to load.
  | start_iter | An iterator indicating the starting point.
  | recursive | if false, only immediate children of the parent are searched. If true, this searches the entire subtree.

Returns:
  A valid iterator to the desired file, or an invalid iterator if the file was not found.

Gtk::TreeModel::iterator Hildon::FileSystemModel::search_uri | ( | const Glib::ustring & | uri,
|  | bool | recursive = `true` |
| ) |  |  | const

Searches the model for the given URI and returns an iterator pointing to it.

Note that the path must already exist in the model.

Parameters:

  | uri | a URI to load.
  | recursive | if false, only immediate children of the parent are searched. If true, this searches the entire subtree.

Returns:
  A valid iterator to the desired file, or an invalid iterator if the file was not found.

void Hildon::FileSystemModel::set_iter_available | ( | const Gtk::TreeModel::iterator & | iter,
|  | bool | available |
| ) |  |  |

This function sets some paths available/not available.

Locations that are not available are usually shown dimmed in the gui. This function can be used if program needs for some reason to disable some locations. By default all paths are available.

Parameters:

  | iter | A Gtk::TreeIter to location to modify.
  | available | New availability state.

Glib::SignalProxy1< void,const Gtk::TreeModel::iterator& > Hildon::FileSystemModel::signal_device_disconnected | ( |  | ) |

Prototype:
  `void device_disconnected(const Gtk::TreeModel::iterator& iter)`

Glib::SignalProxy1< void,const Gtk::TreeModel::iterator& > Hildon::FileSystemModel::signal_finished_loading | ( |  | ) |

Prototype:
  `void finished_loading(const Gtk::TreeModel::iterator& iter)`

## Friends And Related Function Documentation

Glib::RefPtr<Hildon::FileSystemModel> wrap | ( | HildonFileSystemModel * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

Parameters:

  | object | The C instance

Parameters:

  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

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

- file-system-model.h