class EditTextObject; class OutlinerParaObject; class SdrCaptionObj; class SdrPage;
class ScDocument; namespace tools { class Rectangle; } struct ScCaptionInitData;
/** Internal data for a cell annotation. */ struct ScNoteData
{ typedef std::shared_ptr< ScCaptionInitData > ScCaptionInitDataRef;
OUString maDate; /// Creation date of the note.
OUString maAuthor; /// Author of the note.
ScCaptionInitDataRef mxInitData; /// Initial data for invisible notes without SdrObject.
rtl::Reference<SdrCaptionObj> mxCaption; /// Drawing object representing the cell note. bool mbShown; /// True = note is visible.
/** Creates an empty note and its caption object and places it according to
the passed cell position. */ explicit ScPostIt( ScDocument& rDoc, const ScAddress& rPos, sal_uInt32 nPostItId = 0 );
/** Copy constructor. Clones the note and its caption to a new document. */ explicit ScPostIt( ScDocument& rDoc, const ScAddress& rPos, const ScPostIt& rNote, sal_uInt32 nPostItId = 0 );
/** Creates a note from the passed note data with existing caption object.
/** Returns the data struct containing all note settings. */ const ScNoteData& GetNoteData() const { return maNoteData;}
/** Returns the creation date of this note. */ const OUString& GetDate() const { return maNoteData.maDate;} /** Sets a new creation date for this note. */ void SetDate( const OUString& rDate );
/** Returns the author date of this note. */ const OUString& GetAuthor() const { return maNoteData.maAuthor;} /** Sets a new author date for this note. */
SC_DLLPUBLIC void SetAuthor( const OUString& rAuthor );
/** Sets date and author from system settings. */ void AutoStamp(bool bCreate = true);
/** Returns the pointer to the current outliner object, or null. */ const OutlinerParaObject* GetOutlinerObject() const; /** Returns the pointer to the current edit text object, or null. */
SC_DLLPUBLIC const EditTextObject* GetEditTextObject() const;
/** Returns the caption text of this note. */
SC_DLLPUBLIC OUString GetText() const; /** Changes the caption text of this note. All text formatting will be lost. */
SC_DLLPUBLIC void SetText( const ScAddress& rPos, const OUString& rText );
/** Returns an existing note caption object. returns null, if the note containsinitialcaptiondataneededtoconstructacaptionobject. TheSdrCaptionObj*returnedisstillmanagedbytheunderlying
ScNoteData::ScCaptionPtr and must not be stored elsewhere. */
SdrCaptionObj* GetCaption() const { return maNoteData.mxCaption.get();} /** Returns the caption object of this note. Creates the caption object, if thenotecontainsinitialcaptiondatainsteadofthecaption. TheSdrCaptionObj*returnedisstillmanagedbytheunderlying
ScNoteData::ScCaptionPtr and must not be stored elsewhere. */
SC_DLLPUBLIC SdrCaptionObj* GetOrCreateCaption( const ScAddress& rPos ) const;
/** Forgets the pointer to the note caption object.
/** Creates the caption object from initial caption data if existing. */ void CreateCaptionFromInitData( const ScAddress& rPos ) const; /** Creates a new caption object at the passed cell position, clones passed existing caption. */ void CreateCaption( const ScAddress& rPos, const SdrCaptionObj* pCaption = nullptr ); /** Removes the caption object from the drawing layer, if this note is its owner. */ void RemoveCaption();
private:
ScDocument& mrDoc; /// Parent document containing the note. mutable ScNoteData maNoteData; /// Note data with pointer to caption object.
sal_uInt32 mnPostItId;
};
// similar to above, except xGenerator is a functor to apply import // properties to the caption object to finalize it on demand static ScPostIt* CreateNoteFromGenerator(
ScDocument& rDoc, const ScAddress& rPos,
std::unique_ptr<GenerateNoteCaption> xGenerator, const tools::Rectangle& rCaptionRect, bool bShown );
/** Creates a cell note based on the passed string and inserts it into the document.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.