include/svx/GenericCheckDialog.hxx          |   23 ++++++++++++++++++++++-
 sd/source/ui/inc/tools/GraphicSizeCheck.hxx |   13 +++++++++++++
 sd/source/ui/tools/GraphicSizeCheck.cxx     |    8 ++++++++
 sw/source/core/inc/GraphicSizeCheck.hxx     |   13 +++++++++++++
 4 files changed, 56 insertions(+), 1 deletion(-)

New commits:
commit e17f003b5feb8da26498f317914eb2eb83be834b
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Mon Jan 10 17:16:30 2022 +0900
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Mon Jan 10 13:51:08 2022 +0100

    document GenericCheckDialog, GraphicSizeCheck and related classes
    
    Change-Id: If3f8c33601f7823c87b75d601e0b8620d4bfe197
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128205
    Tested-by: Tomaž Vajngerl <[email protected]>
    Reviewed-by: Tomaž Vajngerl <[email protected]>

diff --git a/include/svx/GenericCheckDialog.hxx 
b/include/svx/GenericCheckDialog.hxx
index ef2a41159737..9878ea9fab2a 100644
--- a/include/svx/GenericCheckDialog.hxx
+++ b/include/svx/GenericCheckDialog.hxx
@@ -16,20 +16,34 @@
 
 namespace svx
 {
+/**
+ * Interface for the data of a check, which must be extended by the
+ * check itself, to show the data in the GenericCheckDialog.
+ */
 class CheckData
 {
 public:
     virtual ~CheckData() {}
 
+    /// check entry text
     virtual OUString getText() = 0;
 
+    /// true, if we can show the "Mark" button
     virtual bool canMarkObject() = 0;
+    /// executed, when the "Mark" button is hit
     virtual void markObject() = 0;
 
+    /// true, if we can show the "Properties" button
     virtual bool hasProperties() = 0;
+    /// executed, when the "Properties" button is hit
     virtual void runProperties() = 0;
 };
 
+/**
+ * Check data collection contains all the checks in one data structure,
+ * and also serves to define additional attributes that are used by the
+ * GenericCheckDialog (the title of the check dialog).
+ */
 class CheckDataCollection
 {
 protected:
@@ -43,6 +57,10 @@ public:
     virtual OUString getTitle() = 0;
 };
 
+/**
+ * A UI piece to show check result text and other widgets, which are
+ * relevant for the check (various buttons to act on the check result).
+ */
 class GenericCheckEntry final
 {
 private:
@@ -63,13 +81,16 @@ public:
     DECL_LINK(PropertiesButtonClicked, weld::Button&, void);
 };
 
+/**
+ * This is a generic dialog, which is used to display results of a
+ * document checks, like for example image size check.
+ */
 class SVX_DLLPUBLIC GenericCheckDialog final : public 
weld::GenericDialogController
 {
 private:
     std::vector<std::unique_ptr<GenericCheckEntry>> m_aCheckEntries;
     CheckDataCollection& m_rCheckDataCollection;
 
-    // Controls
     std::unique_ptr<weld::Box> m_xCheckBox;
 
 public:
diff --git a/sd/source/ui/inc/tools/GraphicSizeCheck.hxx 
b/sd/source/ui/inc/tools/GraphicSizeCheck.hxx
index 9da3d569bd3a..1b0c4ff39559 100644
--- a/sd/source/ui/inc/tools/GraphicSizeCheck.hxx
+++ b/sd/source/ui/inc/tools/GraphicSizeCheck.hxx
@@ -17,6 +17,10 @@
 
 namespace sd
 {
+/**
+ * Class resposible to check if a graphic object violates the size
+ * constraints and store the results.
+ */
 class GraphicSizeViolation final
 {
 private:
@@ -45,6 +49,10 @@ public:
     sal_Int32 getDPIY() { return m_nDPIY; }
 };
 
+/**
+ * Run the graphic size checks for all the graphic objects in the DOM
+ * and store a list of violations.
+ */
 class GraphicSizeCheck final
 {
 private:
@@ -65,6 +73,7 @@ public:
     }
 };
 
+/** The UI part of the GraphicSizeViolation used by GenericCheckDialog */
 class GraphicSizeCheckGUIEntry : public svx::CheckData
 {
 private:
@@ -90,6 +99,10 @@ public:
     void runProperties() override;
 };
 
+/**
+ * The UI part presenting the graphic size check results, which is
+ * used by GenericCheckDialog
+ */
 class GraphicSizeCheckGUIResult : public svx::CheckDataCollection
 {
 public:
diff --git a/sd/source/ui/tools/GraphicSizeCheck.cxx 
b/sd/source/ui/tools/GraphicSizeCheck.cxx
index 14bfcf3353b9..14a5b02d4484 100644
--- a/sd/source/ui/tools/GraphicSizeCheck.cxx
+++ b/sd/source/ui/tools/GraphicSizeCheck.cxx
@@ -24,6 +24,10 @@ namespace sd
 {
 namespace
 {
+/**
+ * Intefece for the visitor class, which handles each visited SdrObject
+ * in the DOM.
+ */
 class ModelTraverseHandler
 {
 public:
@@ -32,6 +36,10 @@ public:
     virtual void handleSdrObject(SdrObject* pObject) = 0;
 };
 
+/**
+ * Traverses the DOM and calls a handler for each object (SdrObject) it
+ * encounters.
+ */
 class ModelTraverser
 {
 private:
diff --git a/sw/source/core/inc/GraphicSizeCheck.hxx 
b/sw/source/core/inc/GraphicSizeCheck.hxx
index f708b0a5f4dc..d5ae42084566 100644
--- a/sw/source/core/inc/GraphicSizeCheck.hxx
+++ b/sw/source/core/inc/GraphicSizeCheck.hxx
@@ -16,6 +16,10 @@
 
 namespace sw
 {
+/**
+ * Class resposible to check if a graphic object violates the size
+ * constraints and store the results.
+ */
 class GraphicSizeViolation final
 {
 private:
@@ -42,6 +46,10 @@ public:
     sal_Int32 getDPIY() { return m_nDPIY; }
 };
 
+/**
+ * Run the graphic size checks for all the graphic objects in the DOM
+ * and store a list of violations.
+ */
 class GraphicSizeCheck final
 {
 private:
@@ -62,6 +70,7 @@ public:
     }
 };
 
+/** The UI part of the GraphicSizeViolation used by GenericCheckDialog */
 class GraphicSizeCheckGUIEntry : public svx::CheckData
 {
 private:
@@ -86,6 +95,10 @@ public:
     void runProperties() override;
 };
 
+/**
+ * The UI part presenting the graphic size check results, which is
+ * used by GenericCheckDialog
+ */
 class GraphicSizeCheckGUIResult : public svx::CheckDataCollection
 {
 public:

Reply via email to