+
+size_t wxFileType::GetAllCommands(wxArrayString *verbs,
+ wxArrayString *commands,
+ const wxFileType::MessageParameters& params) const
+{
+ if ( verbs )
+ verbs->Clear();
+ if ( commands )
+ commands->Clear();
+
+#if defined (__WXMSW__) || defined(__UNIX__)
+ return m_impl->GetAllCommands(verbs, commands, params);
+#else // !__WXMSW__ || Unix
+ // we don't know how to retrieve all commands, so just try the 2 we know
+ // about
+ size_t count = 0;
+ wxString cmd;
+ if ( GetOpenCommand(&cmd, params) )
+ {
+ if ( verbs )
+ verbs->Add(wxT("Open"));
+ if ( commands )
+ commands->Add(cmd);
+ count++;
+ }
+
+ if ( GetPrintCommand(&cmd, params) )
+ {
+ if ( verbs )
+ verbs->Add(wxT("Print"));
+ if ( commands )
+ commands->Add(cmd);
+
+ count++;
+ }
+
+ return count;
+#endif // __WXMSW__/| __UNIX__
+}
+
+bool wxFileType::Unassociate()
+{
+#if defined(__WXMSW__)
+ return m_impl->Unassociate();
+#elif defined(__UNIX__)
+ return m_impl->Unassociate(this);
+#else
+ wxFAIL_MSG( wxT("not implemented") ); // TODO
+ return false;
+#endif
+}
+
+bool wxFileType::SetCommand(const wxString& cmd,
+ const wxString& verb,
+ bool overwriteprompt)
+{
+#if defined (__WXMSW__) || defined(__UNIX__)
+ return m_impl->SetCommand(cmd, verb, overwriteprompt);
+#else
+ wxUnusedVar(cmd);
+ wxUnusedVar(verb);
+ wxUnusedVar(overwriteprompt);
+ wxFAIL_MSG(wxT("not implemented"));
+ return false;
+#endif
+}
+
+bool wxFileType::SetDefaultIcon(const wxString& cmd, int index)
+{
+ wxString sTmp = cmd;
+#ifdef __WXMSW__
+ // VZ: should we do this?
+ // chris elliott : only makes sense in MS windows
+ if ( sTmp.empty() )
+ GetOpenCommand(&sTmp, wxFileType::MessageParameters(wxEmptyString, wxEmptyString));
+#endif
+ wxCHECK_MSG( !sTmp.empty(), false, wxT("need the icon file") );
+
+#if defined (__WXMSW__) || defined(__UNIX__)
+ return m_impl->SetDefaultIcon (cmd, index);
+#else
+ wxUnusedVar(index);
+ wxFAIL_MSG(wxT("not implemented"));
+ return false;
+#endif
+}
+
+// ----------------------------------------------------------------------------
+// wxMimeTypesManagerFactory
+// ----------------------------------------------------------------------------
+
+wxMimeTypesManagerFactory *wxMimeTypesManagerFactory::m_factory = NULL;
+
+/* static */
+void wxMimeTypesManagerFactory::Set(wxMimeTypesManagerFactory *factory)
+{
+ delete m_factory;
+
+ m_factory = factory;
+}
+
+/* static */
+wxMimeTypesManagerFactory *wxMimeTypesManagerFactory::Get()
+{
+ if ( !m_factory )
+ m_factory = new wxMimeTypesManagerFactory;
+
+ return m_factory;
+}
+
+wxMimeTypesManagerImpl *wxMimeTypesManagerFactory::CreateMimeTypesManagerImpl()
+{
+ return new wxMimeTypesManagerImpl;
+}
+