Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 014ec55d90fdad9125af7b65e4977762 > files > 6

gnome-vfsmm2.6-doc-2.22.0-1mdv2008.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>libgnomevfsmm: application-registry.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.5 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="classes.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
<h1>application-registry.h</h1><a href="application-registry_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* $Id: application-registry.h 864 2006-10-31 09:06:50Z murrayc $ */</span>
<a name="l00002"></a>00002 
<a name="l00003"></a>00003 <span class="comment">/* Copyright 2003 gnome-vfsmm Development Team</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00006"></a>00006 <span class="comment"> * modify it under the terms of the GNU Library General Public</span>
<a name="l00007"></a>00007 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00008"></a>00008 <span class="comment"> * version 2 of the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00013"></a>00013 <span class="comment"> * Library General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU Library General Public</span>
<a name="l00016"></a>00016 <span class="comment"> * License along with this library; if not, write to the Free</span>
<a name="l00017"></a>00017 <span class="comment"> * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span>
<a name="l00018"></a>00018 <span class="comment"> */</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 
<a name="l00021"></a>00021 <span class="preprocessor">#ifndef _LIBGNOMEVFSMM_APPLICATION_REGISTRY_H</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define _LIBGNOMEVFSMM_APPLICATION_REGISTRY_H</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;glibmm.h&gt;</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;<a class="code" href="enums_8h.html">libgnomevfsmm/enums.h</a>&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;<a class="code" href="exception_8h.html">libgnomevfsmm/exception.h</a>&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;<a class="code" href="mime-application_8h.html">libgnomevfsmm/mime-application.h</a>&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;libgnomevfs/gnome-vfs-application-registry.h&gt;</span>
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="keyword">namespace </span>Gnome
<a name="l00033"></a>00033 {
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="keyword">namespace </span>Vfs
<a name="l00036"></a>00036 {
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="comment">//TODO: Some explanation of how/when this might be used.</span>
<a name="l00039"></a>00039 <span class="comment">//TODO: There seems to be some duplication of functinoality between here and the Mime namespace.</span>
<a name="l00040"></a>00040 <span class="comment">//At first glance it seems like something that would be used by the GNOME file-types control panel, and nothing else. Murray.</span>
<a name="l00041"></a><a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html">00041</a> <span class="keyword">namespace </span>ApplicationRegistry
<a name="l00042"></a>00042 {
<a name="l00043"></a>00043 
<a name="l00044"></a><a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#3e0992b14ecfe064fa1d17dac489fa49">00044</a> <span class="keyword">typedef</span> Glib::ListHandle&lt;Glib::ustring&gt; <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#3e0992b14ecfe064fa1d17dac489fa49">ListHandleStrings</a>;
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 
<a name="l00052"></a>00052 <span class="keywordtype">bool</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#1c492cd1aad71abe85d09df988188705" title="Check to see if there is an entry for app_id in the registry.">exists</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id);
<a name="l00053"></a>00053 
<a name="l00054"></a>00054 <span class="comment">//TODO: Explain what a key is? Why does each application have keys? Murray.</span>
<a name="l00055"></a>00055 
<a name="l00061"></a>00061 <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#3e0992b14ecfe064fa1d17dac489fa49">ListHandleStrings</a> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#25477288cedb42ed48a5495b4151e5eb" title="Get a list of keys for a specified application in the registry.">get_keys</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id);
<a name="l00062"></a>00062 
<a name="l00069"></a>00069 Glib::ustring <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#975e567a1ddacf93ad430ecbd60013b3" title="Get the value associated with key for app_id in the registry.">peek_value</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id, <span class="keyword">const</span> Glib::ustring&amp; key);
<a name="l00070"></a>00070 
<a name="l00071"></a>00071 <span class="comment">//TODO: "the structure pointed to by @a app_id" doesn't make much sense here. Is it an application or a structure? Murray.</span>
<a name="l00072"></a>00072 <span class="comment">//TODO: This looks like a simple convenience method. If so, it should say so.</span>
<a name="l00073"></a>00073 <span class="comment">//TODO: Why does this have the got_key() method, but peek_value() doesn't.</span>
<a name="l00074"></a>00074 <span class="comment">//TODO: Should peek_value() be called get_value()?</span>
<a name="l00082"></a>00082 <span class="comment"></span><span class="keywordtype">bool</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#53fec8368d553138eee13a9abf0343a7" title="Look up a key in the structure pointed to by app_id and return the boolean value...">get_bool_value</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id, <span class="keyword">const</span> Glib::ustring&amp; key, <span class="keywordtype">bool</span>&amp; got_key);
<a name="l00083"></a>00083 
<a name="l00089"></a>00089 <span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#999e326221ec03b690823acb4d717291" title="Remove the application represented by app_id from the registry.">remove_application</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id);
<a name="l00090"></a>00090 
<a name="l00098"></a>00098 <span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#ff5494044be4fc8969a2c64b7ca2b31a" title="Set values pertaining to the registry entry pointed to by app_id.">set_value</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id, <span class="keyword">const</span> Glib::ustring&amp; key, <span class="keyword">const</span> Glib::ustring&amp; value);
<a name="l00099"></a>00099 
<a name="l00100"></a>00100 <span class="comment">//TODO: Consider calling sync() automatically - we need to investigate possible performance problems of doing this. Murray.</span>
<a name="l00101"></a>00101 <span class="comment">//TODO: The default argument here is only appropriate if a bool is more likely to be used than any other type,</span>
<a name="l00102"></a>00102 <span class="comment">//      and if so we should have bool get_value() and string get_string_value().</span>
<a name="l00110"></a>00110 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#ff5494044be4fc8969a2c64b7ca2b31a" title="Set values pertaining to the registry entry pointed to by app_id.">set_value</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id, <span class="keyword">const</span> Glib::ustring&amp; key, <span class="keywordtype">bool</span> value = <span class="keyword">true</span>);
<a name="l00111"></a>00111 
<a name="l00112"></a>00112 <span class="comment">//TODO: Say what would happen when get_value() is then used.</span>
<a name="l00119"></a>00119 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#2d067daa002e444c236227710b5716d3" title="Wipe the current value that key contains for app_id.">unset_key</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id, <span class="keyword">const</span> Glib::ustring&amp; key);
<a name="l00120"></a>00120 
<a name="l00121"></a>00121 <span class="comment">/*</span>
<a name="l00122"></a>00122 <span class="comment"> * Query functions</span>
<a name="l00123"></a>00123 <span class="comment"> */</span>
<a name="l00124"></a>00124 
<a name="l00130"></a>00130 <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#3e0992b14ecfe064fa1d17dac489fa49">ListHandleStrings</a> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#0c0428c28c87f429cbcd0b86d16c2356" title="Get all application IDs from the registry that are associated with the given MIME...">get_applications</a>(<span class="keyword">const</span> Glib::ustring&amp; mime_type);
<a name="l00131"></a>00131 
<a name="l00137"></a>00137 <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#3e0992b14ecfe064fa1d17dac489fa49">ListHandleStrings</a> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#a6a304addaff5e3bd300879f146b96d8" title="Get all MIME types that can be handled by an application.">get_mime_types</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id);
<a name="l00138"></a>00138 
<a name="l00145"></a>00145 <span class="keywordtype">bool</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#c9840ad204ad6ea581a3e9fd06915486" title="Checks whether an application is associated with a given MIME type.">supports_mime_type</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id, <span class="keyword">const</span> Glib::ustring&amp; mime_type);
<a name="l00146"></a>00146 
<a name="l00154"></a>00154 <span class="keywordtype">bool</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#e2ee898342028ae4df778d0f3076fff8" title="Checks whether an application supports the given URI scheme.">supports_uri_scheme</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id, <span class="keyword">const</span> Glib::ustring&amp; uri_scheme);
<a name="l00155"></a>00155 
<a name="l00156"></a>00156 <span class="comment">/*</span>
<a name="l00157"></a>00157 <span class="comment"> * Mime type functions</span>
<a name="l00158"></a>00158 <span class="comment"> * Note that mime_type can be a specific(image/png) or generic (image/&lt;star&gt;) type</span>
<a name="l00159"></a>00159 <span class="comment"> */</span>
<a name="l00160"></a>00160 
<a name="l00166"></a>00166 <span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#38be37428cb71ec280d370723fc910f2" title="Remove the MIME types associated with an application.">clear_mime_types</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id);
<a name="l00167"></a>00167 
<a name="l00174"></a>00174 <span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#37023cc45b955d494893ac835333bd53" title="Associate an MIME type with an application.">add_mime_type</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id, <span class="keyword">const</span> Glib::ustring&amp; mime_type);
<a name="l00175"></a>00175 
<a name="l00182"></a>00182 <span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#ea65fd5dd4d4f7469c570f23644d52dc" title="De-Associate an MIME type from an application.">remove_mime_type</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id, <span class="keyword">const</span> Glib::ustring&amp; mime_type);
<a name="l00183"></a>00183 
<a name="l00184"></a>00184 
<a name="l00188"></a>00188 <span class="preprocessor">#ifdef GLIBMM_EXCEPTIONS_ENABLED</span>
<a name="l00189"></a>00189 <span class="preprocessor"></span><span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#d6123580d256df79a263db73a4d7ea83" title="This function will sync the registry.">sync</a>() throw(<a class="code" href="classGnome_1_1Vfs_1_1exception.html">exception</a>);
<a name="l00190"></a>00190 <span class="preprocessor">#else</span>
<a name="l00191"></a>00191 <span class="preprocessor"></span><span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#d6123580d256df79a263db73a4d7ea83" title="This function will sync the registry.">sync</a>(std::auto_ptr&lt;Gnome::Vfs::exception&gt;&amp; error);
<a name="l00192"></a>00192 <span class="preprocessor">#endif</span>
<a name="l00193"></a>00193 <span class="preprocessor"></span>
<a name="l00194"></a>00194 <span class="comment">//TODO: What does "free resources" mean. Are we blocking another application from doing the same thing?</span>
<a name="l00195"></a>00195 <span class="comment">//      How is this different to sync()? Do we need to do both? Murray</span>
<a name="l00198"></a>00198 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#5c3fbf2ab97d520c3794db8ce418db3c" title="Synchronize the application registry data to disk and free resources.">shutdown</a>();
<a name="l00199"></a>00199 
<a name="l00200"></a>00200 <span class="comment">//TODO: So, when would we need to call this? Murray.</span>
<a name="l00204"></a>00204 <span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#71acaace926923deeef8e0ea2a5046e0" title="If this function is called for the first time, it will initialize the registry.">reload</a>();
<a name="l00205"></a>00205 
<a name="l00206"></a>00206 <span class="comment">/*</span>
<a name="l00207"></a>00207 <span class="comment"> * Integrating with gnome-vfs-mime-handlers</span>
<a name="l00208"></a>00208 <span class="comment"> */</span>
<a name="l00209"></a>00209 
<a name="l00210"></a>00210 <span class="comment">//TODO: How is a MimeApplication different to an Application? Murray.</span>
<a name="l00216"></a>00216 <span class="comment"></span><a class="code" href="classGnome_1_1Vfs_1_1MimeApplication.html">MimeApplication</a> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#c218314e2e358bb98cd54a235576db7e" title="Get the MimeApplication associated with app_id .">get_mime_application</a>(<span class="keyword">const</span> Glib::ustring&amp; app_id);
<a name="l00217"></a>00217 
<a name="l00221"></a>00221 <span class="keywordtype">void</span> <a class="code" href="namespaceGnome_1_1Vfs_1_1ApplicationRegistry.html#e27fa9360de7eb9e1a41591d381ee78c" title="Save an application to the registry that will be associated with a defined MIME type...">save_mime_application</a>(<span class="keyword">const</span> <a class="code" href="classGnome_1_1Vfs_1_1MimeApplication.html">MimeApplication</a>&amp; application);
<a name="l00222"></a>00222 
<a name="l00223"></a>00223 } <span class="comment">//namespace ApplicationRegistry</span>
<a name="l00224"></a>00224 
<a name="l00225"></a>00225 } <span class="comment">// namespace Vfs</span>
<a name="l00226"></a>00226 } <span class="comment">// namespace Gnome</span>
<a name="l00227"></a>00227 
<a name="l00228"></a>00228 
<a name="l00229"></a>00229 
<a name="l00230"></a>00230 
<a name="l00231"></a>00231 <span class="preprocessor">#endif </span><span class="comment">/* _LIBGNOMEVFSMM_APPLICATION_REGISTRY_H */</span>
<a name="l00232"></a>00232 
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Mar 9 14:42:03 2008 for libgnomevfsmm by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
</body>
</html>