• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ie_exp_HTML_NavigationHelper.h

Go to the documentation of this file.
00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
00002 
00003 /* AbiSource
00004  *
00005  * Copyright (C) 2011 Volodymyr Rudyj <vladimir.rudoy@gmail.com>
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301 USA.
00021  */
00022 #ifndef IE_EXP_HTML_NAVIGATIONHELPER_H
00023 #define IE_EXP_HTML_NAVIGATIONHELPER_H
00024 
00025 #include "ie_exp_HTML_util.h"
00026 
00027 // External includes
00028 #include <vector>
00029 #include <string>
00030 #include <gsf/gsf-output.h>
00031 
00032 // Abiword includes
00033 #include <pd_Document.h>
00034 #include <pl_Listener.h>
00035 #include <px_ChangeRecord.h>
00036 #include <px_CR_Span.h>
00037 #include <px_CR_Strux.h>
00038 #include <px_CR_Object.h>
00039 #include <fd_Field.h>
00040 #include <fl_TOCLayout.h>
00041 #include <ie_Table.h>
00042 #include <ie_TOC.h>
00043 #include <ut_go_file.h>
00044 
00045 
00046 class ABI_EXPORT IE_Exp_HTML_NavigationHelper : public IE_TOCHelper {
00047 public:
00048     IE_Exp_HTML_NavigationHelper(PD_Document *pDocument,
00049             const UT_UTF8String &baseName);
00050     virtual ~IE_Exp_HTML_NavigationHelper();
00051 
00052     UT_UTF8String getBookmarkFilename(const UT_UTF8String &id) const;
00053     UT_UTF8String getFilenameByPosition(PT_DocPosition position) const;
00054     inline int getMinTOCLevel() const { return m_minTOCLevel; }
00055     inline int getMinTOCIndex() const { return m_minTOCIndex; }
00056     inline std::map<UT_UTF8String, UT_UTF8String> & getBookmarks()
00057         { return m_bookmarks; }
00058 private:
00059     UT_UTF8String m_suffix;
00060     int m_minTOCLevel;
00061     int m_minTOCIndex;
00062     std::map<UT_UTF8String, UT_UTF8String> m_bookmarks;
00063     char* m_baseName;
00064 };
00065 
00066 class ABI_EXPORT IE_Exp_HTML_BookmarkListener : public PL_Listener
00067 {
00068 public:
00069 IE_Exp_HTML_BookmarkListener(PD_Document* pDoc,
00070         IE_Exp_HTML_NavigationHelper *pNavigationHelper);
00071 bool populate(fl_ContainerLayout* sfh,
00072               const PX_ChangeRecord * pcr);
00073 // Not used
00074 
00075 bool populateStrux(pf_Frag_Strux* /*sdh*/,
00076                    const PX_ChangeRecord * /*pcr*/,
00077                    fl_ContainerLayout* * /*psfh*/)
00078 {
00079     return true;
00080 }
00081 // Not used
00082 
00083 bool change(fl_ContainerLayout* /*sfh*/,
00084             const PX_ChangeRecord * /*pcr*/)
00085 {
00086     return true;
00087 }
00088 // Not used
00089 
00090 bool insertStrux(fl_ContainerLayout* /*sfh*/,
00091                  const PX_ChangeRecord * /*pcr*/,
00092                  pf_Frag_Strux* /*sdh*/,
00093                  PL_ListenerId /*lid*/,
00094                  void (* /*pfnBindHandles*/) (pf_Frag_Strux* sdhNew,
00095                  PL_ListenerId lid,
00096                  fl_ContainerLayout* sfhNew))
00097 {
00098     return true;
00099 }
00100 // Not used
00101 
00102 bool signal(UT_uint32 /*iSignal*/)
00103 {
00104     return true;
00105 }
00106 
00107 private:
00108 PD_Document * m_pDoc;
00109 IE_Exp_HTML_NavigationHelper *m_pNavigationHelper;
00110 
00111 };
00112 
00113 #endif  /* IE_EXP_HTML_NAVIGATIONHELPER_H */
00114 

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1