1*23e9c6caSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*23e9c6caSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*23e9c6caSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*23e9c6caSAndrew Rist * distributed with this work for additional information 6*23e9c6caSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*23e9c6caSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*23e9c6caSAndrew Rist * "License"); you may not use this file except in compliance 9*23e9c6caSAndrew Rist * with the License. You may obtain a copy of the License at 10*23e9c6caSAndrew Rist * 11*23e9c6caSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*23e9c6caSAndrew Rist * 13*23e9c6caSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*23e9c6caSAndrew Rist * software distributed under the License is distributed on an 15*23e9c6caSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*23e9c6caSAndrew Rist * KIND, either express or implied. See the License for the 17*23e9c6caSAndrew Rist * specific language governing permissions and limitations 18*23e9c6caSAndrew Rist * under the License. 19*23e9c6caSAndrew Rist * 20*23e9c6caSAndrew Rist *************************************************************/ 21*23e9c6caSAndrew Rist 22*23e9c6caSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _PAD_FONTENTRY_HXX_ 25cdf0e10cSrcweir #define _PAD_FONTENTRY_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "progress.hxx" 28cdf0e10cSrcweir #include "helper.hxx" 29cdf0e10cSrcweir 30cdf0e10cSrcweir #include "vcl/timer.hxx" 31cdf0e10cSrcweir #include "vcl/dialog.hxx" 32cdf0e10cSrcweir #include "vcl/button.hxx" 33cdf0e10cSrcweir #include "vcl/combobox.hxx" 34cdf0e10cSrcweir #include "vcl/lstbox.hxx" 35cdf0e10cSrcweir #include "vcl/group.hxx" 36cdf0e10cSrcweir #include "vcl/fontmanager.hxx" 37cdf0e10cSrcweir 38cdf0e10cSrcweir #include "tools/urlobj.hxx" 39cdf0e10cSrcweir 40cdf0e10cSrcweir namespace padmin { 41cdf0e10cSrcweir 42cdf0e10cSrcweir class FontImportDialog : 43cdf0e10cSrcweir public ModalDialog, 44cdf0e10cSrcweir public ::psp::PrintFontManager::ImportFontCallback 45cdf0e10cSrcweir { 46cdf0e10cSrcweir OKButton m_aOKBtn; 47cdf0e10cSrcweir CancelButton m_aCancelBtn; 48cdf0e10cSrcweir PushButton m_aSelectAllBtn; 49cdf0e10cSrcweir ListBox m_aNewFontsBox; 50cdf0e10cSrcweir FixedLine m_aFromFL; 51cdf0e10cSrcweir Edit m_aFromDirEdt; 52cdf0e10cSrcweir PushButton m_aFromBtn; 53cdf0e10cSrcweir CheckBox m_aSubDirsBox; 54cdf0e10cSrcweir FixedLine m_aTargetOptFL; 55cdf0e10cSrcweir CheckBox m_aLinkOnlyBox; 56cdf0e10cSrcweir FixedText m_aFixedText; 57cdf0e10cSrcweir bool m_bOverwriteAll; 58cdf0e10cSrcweir bool m_bOverwriteNone; 59cdf0e10cSrcweir ProgressDialog* m_pProgress; 60cdf0e10cSrcweir int m_nFont; 61cdf0e10cSrcweir 62cdf0e10cSrcweir String m_aImportOperation; 63cdf0e10cSrcweir String m_aOverwriteQueryText; 64cdf0e10cSrcweir String m_aOverwriteAllText; 65cdf0e10cSrcweir String m_aOverwriteNoneText; 66cdf0e10cSrcweir String m_aNoAfmText; 67cdf0e10cSrcweir String m_aAfmCopyFailedText; 68cdf0e10cSrcweir String m_aFontCopyFailedText; 69cdf0e10cSrcweir String m_aNoWritableFontsDirText; 70cdf0e10cSrcweir String m_aFontsImportedText; 71cdf0e10cSrcweir 72cdf0e10cSrcweir ::std::hash_map< ::rtl::OString, ::std::list< ::psp::FastPrintFontInfo >, ::rtl::OStringHash > 73cdf0e10cSrcweir m_aNewFonts; 74cdf0e10cSrcweir 75cdf0e10cSrcweir Timer m_aRefreshTimer; 76cdf0e10cSrcweir DECL_LINK( RefreshTimeoutHdl, void* ); 77cdf0e10cSrcweir 78cdf0e10cSrcweir 79cdf0e10cSrcweir ::psp::PrintFontManager& m_rFontManager; 80cdf0e10cSrcweir 81cdf0e10cSrcweir DECL_LINK( ClickBtnHdl, Button* ); 82cdf0e10cSrcweir DECL_LINK( ModifyHdl, Edit* ); 83cdf0e10cSrcweir DECL_LINK( ToggleHdl, CheckBox* ); 84cdf0e10cSrcweir 85cdf0e10cSrcweir // implement ImportFontCallback 86cdf0e10cSrcweir virtual void importFontsFailed( ::psp::PrintFontManager::ImportFontCallback::FailCondition eReason ); 87cdf0e10cSrcweir virtual void progress( const ::rtl::OUString& rFile ); 88cdf0e10cSrcweir virtual bool queryOverwriteFile( const ::rtl::OUString& rFile ); 89cdf0e10cSrcweir virtual void importFontFailed( const ::rtl::OUString& rFile, ::psp::PrintFontManager::ImportFontCallback::FailCondition eReason ); 90cdf0e10cSrcweir virtual bool isCanceled(); 91cdf0e10cSrcweir 92cdf0e10cSrcweir void copyFonts(); 93cdf0e10cSrcweir void fillFontBox(); 94cdf0e10cSrcweir public: 95cdf0e10cSrcweir FontImportDialog( Window* ); 96cdf0e10cSrcweir ~FontImportDialog(); 97cdf0e10cSrcweir }; 98cdf0e10cSrcweir 99cdf0e10cSrcweir class FontNameDlg : public ModalDialog 100cdf0e10cSrcweir { 101cdf0e10cSrcweir private: 102cdf0e10cSrcweir OKButton m_aOKButton; 103cdf0e10cSrcweir PushButton m_aRenameButton; 104cdf0e10cSrcweir PushButton m_aRemoveButton; 105cdf0e10cSrcweir PushButton m_aImportButton; 106cdf0e10cSrcweir 107cdf0e10cSrcweir DelListBox m_aFontBox; 108cdf0e10cSrcweir FixedText m_aFixedText; 109cdf0e10cSrcweir 110cdf0e10cSrcweir String m_aRenameString; 111cdf0e10cSrcweir String m_aRenameTTCString; 112cdf0e10cSrcweir String m_aNoRenameString; 113cdf0e10cSrcweir 114cdf0e10cSrcweir ::psp::PrintFontManager& m_rFontManager; 115cdf0e10cSrcweir 116cdf0e10cSrcweir // maps fontID to XLFD 117cdf0e10cSrcweir ::std::hash_map< ::psp::fontID, String > 118cdf0e10cSrcweir m_aFonts; 119cdf0e10cSrcweir void init(); 120cdf0e10cSrcweir public: 121cdf0e10cSrcweir FontNameDlg( Window* ); 122cdf0e10cSrcweir ~FontNameDlg(); 123cdf0e10cSrcweir 124cdf0e10cSrcweir DECL_LINK( ClickBtnHdl, Button* ); 125cdf0e10cSrcweir DECL_LINK( DelPressedHdl, ListBox* ); 126cdf0e10cSrcweir DECL_LINK( SelectHdl, ListBox* ); 127cdf0e10cSrcweir 128cdf0e10cSrcweir static String fillFontEntry( ::psp::FastPrintFontInfo& rInfo, const String& rFile, bool bAddRegular ); 129cdf0e10cSrcweir static String fillFontEntry( const ::std::list< ::psp::FastPrintFontInfo >& rInfos, const String& rFile ); 130cdf0e10cSrcweir }; 131cdf0e10cSrcweir } // namespace 132cdf0e10cSrcweir 133cdf0e10cSrcweir #endif 134