+
+size_t wxFileType::GetAllCommands(wxArrayString *verbs,
+ wxArrayString *commands,
+ const wxFileType::MessageParameters& params) const
+{
+ if ( verbs )
+ verbs->Clear();
+ if ( commands )
+ commands->Clear();
+
+#ifdef __WXMSW__
+ return m_impl->GetAllCommands(verbs, commands, params);
+#else // !__WXMSW__
+ // we don't know how to retrieve all commands, so just try the 2 we know
+ // about
+ size_t count = 0;
+ wxString cmd;
+ if ( m_impl->GetOpenCommand(&cmd, params) )
+ {
+ if ( verbs )
+ verbs->Add(_T("Open"));
+ if ( commands )
+ commands->Add(cmd);
+ count++;
+ }
+
+ if ( GetPrintCommand(&cmd, params) )
+ {
+ if ( verbs )
+ verbs->Add(_T("Print"));
+ if ( commands )
+ commands->Add(cmd);
+
+ count++;
+ }
+
+ return count;
+#endif // __WXMSW__/!__WXMSW__
+}
+
+bool wxFileType::SetOpenCommand(const wxString& cmd, bool overwriteprompt)
+{
+ return SetCommand(cmd, _T("open"), overwriteprompt);
+}
+
+bool wxFileType::SetCommand(const wxString& cmd, const wxString& verb,
+ bool overwriteprompt)
+{
+#ifdef __WXMSW__
+ return m_impl->SetCommand(cmd, verb, overwriteprompt);
+#else
+ wxFAIL_MSG(_T("not implemented"));
+
+ return FALSE;
+#endif
+}
+
+bool wxFileType::SetMimeType(const wxString& mimeType)
+{
+ // empty MIME type is meaningless here
+ wxCHECK_MSG( !mimeType.empty(), FALSE, _T("use RemoveMimeType()") );
+
+#ifdef __WXMSW__
+ return m_impl->SetMimeType(mimeType);
+#else
+ wxFAIL_MSG(_T("not implemented"));
+
+ return FALSE;
+#endif
+}
+
+bool wxFileType::SetDefaultIcon(const wxString& cmd, int index)
+{
+ wxString sTmp = cmd;
+ // VZ: should we do this?
+ if ( sTmp.empty() )
+ GetOpenCommand(&sTmp, wxFileType::MessageParameters("", ""));
+
+ wxCHECK_MSG( !sTmp.empty(), FALSE, _T("need the icon file") );
+
+
+#ifdef __WXMSW__
+ return m_impl->SetDefaultIcon (cmd, index);
+#else
+ wxFAIL_MSG(_T("not implemented"));
+
+ return FALSE;
+#endif
+}
+
+// now do remove functions
+bool wxFileType::RemoveOpenCommand()
+{
+ return RemoveCommand(_T("open"));
+}
+
+bool wxFileType::RemoveCommand(const wxString& verb)
+{
+#ifdef __WXMSW__
+ return m_impl->RemoveCommand(verb);
+#else
+ wxFAIL_MSG(_T("not implemented"));
+
+ return FALSE;
+#endif
+}
+
+bool wxFileType::RemoveMimeType()
+{
+#ifdef __WXMSW__
+ return m_impl->RemoveMimeType ();
+#else
+ wxFAIL_MSG(_T("not implemented"));
+
+ return FALSE;
+#endif
+}
+
+bool wxFileType::RemoveDefaultIcon()
+{
+#ifdef __WXMSW__
+ return m_impl->RemoveDefaultIcon();
+#else
+ wxFAIL_MSG(_T("not implemented"));
+
+ return FALSE;
+#endif
+}
+
+bool wxFileType::Unassociate()
+{
+ bool result = TRUE;
+ if ( !RemoveOpenCommand() )
+ result = FALSE;
+ if ( !RemoveDefaultIcon() )
+ result = FALSE;
+ if ( !RemoveMimeType() )
+ result = FALSE;
+
+ // in MSW this leaves a HKCR.xzy key
+ return result;
+}
+