CRenderedDocumentPreviewGeneratorComp.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 // ACF includes
5 #include <istd/TPointerVector.h>
6 #include <imod/IModel.h>
9 #include <iimg/IBitmap.h>
11 #include <icomp/CComponentBase.h>
12 #include <iproc/IProcessor.h>
13 
14 
15 namespace idocproc
16 {
17 
18 
20  public icomp::CComponentBase,
21  public imod::TSingleModelObserverBase<idoc::IMultiPageDocument>,
22  virtual public iimg::IMultiBitmapProvider
23 {
24 public:
27 
28  I_BEGIN_COMPONENT(CRenderedDocumentPreviewGeneratorComp);
29  I_REGISTER_INTERFACE(iimg::IMultiBitmapProvider);
30  I_REGISTER_INTERFACE(imod::IObserver);
31  I_ASSIGN(m_bitmapFactoryCompPtr, "BitmapFactory", "Factory for the preview bitmap creation", false, "BitmapFactory");
32  I_ASSIGN(m_renderingProcessorCompPtr, "RenderingProcessor", "Processor used for page rendering into a bitmap", true, "RenderingProcessor");
33  I_ASSIGN(m_imageSizeAttrPtr, "ImageSize", "Image size in pixel using for rendering of the document page", true, 4096);
34  I_ASSIGN(m_pageSelectionAttrPtr, "PageSelectionParamId", "ID of the page selection in the parameter set used by the rendering processor", true, "PageSelection");
35  I_END_COMPONENT;
36 
37  // reimplemented (iimg::IMultiBitmapProvider)
38  virtual const iprm::IOptionsList* GetBitmapListInfo() const;
39  virtual int GetBitmapsCount() const;
40  virtual const iimg::IBitmap* GetBitmap(int bitmapIndex) const;
41 
42 protected:
43  // reimplemented (imod::IObserver)
44  virtual bool OnDetached(imod::IModel* modelPtr);
45 
46  // reimplemented (imod::CSingleModelObserverBase)
47  virtual void OnUpdate(int updateFlags, istd::IPolymorphic* updateParamsPtr);
48 
49 private:
50  void EnsurePreviewGenerated();
51 
52 private:
53  I_FACT(iimg::IBitmap, m_bitmapFactoryCompPtr);
54  I_REF(iproc::IProcessor, m_renderingProcessorCompPtr);
55  I_ATTR(int, m_imageSizeAttrPtr);
56  I_ATTR(QByteArray, m_pageSelectionAttrPtr);
57 
59 
60  PreviewBitmaps m_previewBitmaps;
61 };
62 
63 
64 } // namespace idocproc
65 
66 
virtual void OnUpdate(int updateFlags, istd::IPolymorphic *updateParamsPtr)
imod::TSingleModelObserverBase< idoc::IMultiPageDocument > BaseClass2
Interface for all synchrone and assynchrone processors with "push data" model.
Definition: IProcessor.h:24
virtual const iprm::IOptionsList * GetBitmapListInfo() const
virtual bool OnDetached(imod::IModel *modelPtr)
virtual const iimg::IBitmap * GetBitmap(int bitmapIndex) const

© 2007-2011 Witold Gantzke and Kirill Lepskiy