KEYContentCollector.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is part of the libetonyek project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  */
00009 
00010 #ifndef KEYCONTENTCOLLECTOR_H_INCLUDED
00011 #define KEYCONTENTCOLLECTOR_H_INCLUDED
00012 
00013 #include "KEYCollectorBase.h"
00014 #include "KEYTypes.h"
00015 
00016 namespace libetonyek
00017 {
00018 
00019 struct KEYDictionary;
00020 class KEYPresentationInterface;
00021 
00022 class KEYContentCollector : public KEYCollectorBase
00023 {
00024   // disable copying
00025   KEYContentCollector(const KEYContentCollector &other);
00026   KEYContentCollector &operator=(const KEYContentCollector &other);
00027 
00028 public:
00029   KEYContentCollector(KEYPresentationInterface *painter, KEYDictionary &dict, const KEYLayerMap_t &masterPages, const KEYSize &size, const KEYDefaults &defaults);
00030   virtual ~KEYContentCollector();
00031 
00032   // collector functions
00033 
00034   virtual void collectPresentation(const boost::optional<KEYSize> &size);
00035 
00036   virtual void collectLayer(const boost::optional<ID_t> &id, bool ref);
00037   virtual void collectPage(const boost::optional<ID_t> &id);
00038 
00039   virtual void startSlides();
00040   virtual void endSlides();
00041   virtual void startThemes();
00042   virtual void endThemes();
00043 
00044   virtual void startPage();
00045   virtual void endPage();
00046   virtual void startLayer();
00047   virtual void endLayer();
00048 
00049 private:
00050   // helper functions
00051 
00052   void resolveStyle(KEYStyle &style);
00053 
00054   void drawLayer(const KEYLayerPtr_t &layer);
00055   void drawNotes(const KEYObjectList_t &notes);
00056   void drawStickyNotes(const KEYStickyNotes_t &stickyNotes);
00057 
00058 private:
00059   KEYPresentationInterface *m_painter;
00060 
00061   const KEYLayerMap_t &m_masterPages;
00062   const KEYSize m_size;
00063 
00064   bool m_pageOpened;
00065   bool m_layerOpened;
00066 
00067   int m_layerCount;
00068 };
00069 
00070 } // namespace libetonyek
00071 
00072 #endif // KEYCONTENTCOLLECTOR_H_INCLUDED
00073 
00074 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */