PCL
MetaProcess.h
Go to the documentation of this file.
1 // ____ ______ __
2 // / __ \ / ____// /
3 // / /_/ // / / /
4 // / ____// /___ / /___ PixInsight Class Library
5 // /_/ \____//_____/ PCL 2.7.0
6 // ----------------------------------------------------------------------------
7 // pcl/MetaProcess.h - Released 2024-06-18T15:48:54Z
8 // ----------------------------------------------------------------------------
9 // This file is part of the PixInsight Class Library (PCL).
10 // PCL is a multiplatform C++ framework for development of PixInsight modules.
11 //
12 // Copyright (c) 2003-2024 Pleiades Astrophoto S.L. All Rights Reserved.
13 //
14 // Redistribution and use in both source and binary forms, with or without
15 // modification, is permitted provided that the following conditions are met:
16 //
17 // 1. All redistributions of source code must retain the above copyright
18 // notice, this list of conditions and the following disclaimer.
19 //
20 // 2. All redistributions in binary form must reproduce the above copyright
21 // notice, this list of conditions and the following disclaimer in the
22 // documentation and/or other materials provided with the distribution.
23 //
24 // 3. Neither the names "PixInsight" and "Pleiades Astrophoto", nor the names
25 // of their contributors, may be used to endorse or promote products derived
26 // from this software without specific prior written permission. For written
27 // permission, please contact info@pixinsight.com.
28 //
29 // 4. All products derived from this software, in any form whatsoever, must
30 // reproduce the following acknowledgment in the end-user documentation
31 // and/or other materials provided with the product:
32 //
33 // "This product is based on software from the PixInsight project, developed
34 // by Pleiades Astrophoto and its contributors (https://pixinsight.com/)."
35 //
36 // Alternatively, if that is where third-party acknowledgments normally
37 // appear, this acknowledgment must be reproduced in the product itself.
38 //
39 // THIS SOFTWARE IS PROVIDED BY PLEIADES ASTROPHOTO AND ITS CONTRIBUTORS
40 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
41 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PLEIADES ASTROPHOTO OR ITS
43 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44 // EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, BUSINESS
45 // INTERRUPTION; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; AND LOSS OF USE,
46 // DATA OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
47 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49 // POSSIBILITY OF SUCH DAMAGE.
50 // ----------------------------------------------------------------------------
51 
52 #ifndef __PCL_MetaProcess_h
53 #define __PCL_MetaProcess_h
54 
56 
57 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
58 
59 #include <pcl/Defs.h>
60 #include <pcl/Diagnostics.h>
61 
62 #include <pcl/MetaObject.h>
63 #include <pcl/ProcessBase.h>
64 #include <pcl/StringList.h>
65 
66 namespace pcl
67 {
68 
69 // ----------------------------------------------------------------------------
70 
71 class View;
72 class ImageWindow;
73 class ProcessImplementation;
74 class ProcessInterface;
75 class MetaParameter;
76 
106 class PCL_CLASS MetaProcess : public MetaObject, public ProcessBase
107 {
108 public:
109 
114 
119  ~MetaProcess() noexcept( false ) override
120  {
121  }
122 
127  MetaProcess( const MetaProcess& ) = delete;
128 
133  MetaProcess& operator =( const MetaProcess& ) = delete;
134 
139  MetaProcess( MetaProcess&& x ) = delete;
140 
145  MetaProcess& operator =( MetaProcess&& x ) = delete;
146 
149  virtual IsoString Id() const override = 0;
150 
175  virtual IsoString Aliases() const
176  {
177  return IsoString();
178  }
179 
205  virtual IsoString Categories() const
206  {
207  return IsoString(); // General category
208  }
209 
217  virtual IsoString Category() const // ### PCL 2.x: Remove
218  {
219  return Categories();
220  }
221 
236  uint32 Version() const override
237  {
238  return 0x100;
239  }
240 
260  String Description() const override
261  {
262  return String();
263  }
264 
276  String ScriptComment() const override
277  {
278  return String();
279  }
280 
306  virtual IsoString IconImageSVG() const
307  {
308  return IsoString();
309  }
310 
373  virtual String IconImageSVGFile() const
374  {
375  return String();
376  }
377 
404  virtual const char** IconImageXPM() const
405  {
406  return nullptr;
407  }
408 
430  virtual String IconImageFile() const
431  {
432  return String();
433  }
434 
463  virtual const char** SmallIconImageXPM() const
464  {
465  return nullptr;
466  }
467 
486  virtual String SmallIconImageFile() const
487  {
488  return String();
489  }
490 
493  Bitmap Icon() const override;
494 
497  Bitmap SmallIcon() const override;
498 
517  virtual void InitializeClass()
518  {
519  }
520 
547  {
548  return nullptr; // by default, processes have no associated interfaces.
549  }
550 
567  bool CanProcessViews() const override
568  {
569  return true;
570  }
571 
592  bool CanProcessGlobal() const override
593  {
594  return true;
595  }
596 
625  bool CanProcessImages() const override
626  {
627  return false;
628  }
629 
643  bool CanProcessCommandLines() const override
644  {
645  return false;
646  }
647 
660  bool CanEditPreferences() const override
661  {
662  return false;
663  }
664 
685  bool CanBrowseDocumentation() const override
686  {
687  return true;
688  }
689 
703  virtual ProcessImplementation* Create() const = 0;
704 
716  virtual ProcessImplementation* Clone( const ProcessImplementation& ) const = 0;
717 
744  {
745  return Clone( p );
746  }
747 
760  bool IsAssignable() const override
761  {
762  return true; // by default, processes are considered assignable.
763  }
764 
791  bool NeedsInitialization() const override
792  {
793  return false; // by default, process instances are not initialized.
794  }
795 
813  bool NeedsValidation() const override
814  {
815  return false; // by default, process instances are not validated.
816  }
817 
834  bool PrefersGlobalExecution() const override
835  {
836  return false; // by default, processes prefer execution on views.
837  }
838 
850  virtual int ProcessCommandLine( const StringList& argv ) const;
851 
869  bool EditPreferences() const override;
870 
891  bool BrowseDocumentation() const override;
892 
900  const MetaParameter* operator[]( size_type i ) const;
901 
933  virtual bool CanProcessIPCMessages() const
934  {
935  return false;
936  }
937 
957  virtual void IPCStart( int instance, const IsoString& messageUID, const String& parameters ) const;
958 
973  virtual void IPCStop( int instance, const IsoString& messageUID ) const;
974 
994  virtual void IPCSetParameters( int instance, const IsoString& messageUID, const String& parameters ) const;
995 
1020  virtual int IPCStatus( int instance, const IsoString& messageUID ) const;
1021 
1022 private:
1023 
1024  void PerformAPIDefinitions() const override;
1025 };
1026 
1027 // ----------------------------------------------------------------------------
1028 
1029 } // pcl
1030 
1031 #endif // __PCL_BUILDING_PIXINSIGHT_APPLICATION
1032 
1033 #endif // __PCL_MetaProcess_h
1034 
1035 // ----------------------------------------------------------------------------
1036 // EOF pcl/MetaProcess.h - Released 2024-06-18T15:48:54Z
Client-side interface to a PixInsight Bitmap object.
Definition: Bitmap.h:204
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
Definition: String.h:5425
Root base class for all PixInsight module components.
Definition: MetaObject.h:86
Root base class for PCL classes providing formal descriptions of process parameters.
A formal description of a PixInsight process.
Definition: MetaProcess.h:107
virtual const char ** IconImageXPM() const
Definition: MetaProcess.h:404
virtual ProcessImplementation * Create() const =0
virtual void IPCStart(int instance, const IsoString &messageUID, const String &parameters) const
bool NeedsInitialization() const override
Definition: MetaProcess.h:791
virtual IsoString Categories() const
Definition: MetaProcess.h:205
virtual String IconImageSVGFile() const
Definition: MetaProcess.h:373
String ScriptComment() const override
Definition: MetaProcess.h:276
virtual bool CanProcessIPCMessages() const
Definition: MetaProcess.h:933
virtual ProcessImplementation * TestClone(const ProcessImplementation &p) const
Definition: MetaProcess.h:743
virtual int IPCStatus(int instance, const IsoString &messageUID) const
virtual void IPCStop(int instance, const IsoString &messageUID) const
virtual ProcessInterface * DefaultInterface() const
Definition: MetaProcess.h:546
bool CanProcessCommandLines() const override
Definition: MetaProcess.h:643
bool CanEditPreferences() const override
Definition: MetaProcess.h:660
bool BrowseDocumentation() const override
MetaProcess(MetaProcess &&x)=delete
bool CanBrowseDocumentation() const override
Definition: MetaProcess.h:685
const MetaParameter * operator[](size_type i) const
bool NeedsValidation() const override
Definition: MetaProcess.h:813
virtual String SmallIconImageFile() const
Definition: MetaProcess.h:486
Bitmap SmallIcon() const override
bool PrefersGlobalExecution() const override
Definition: MetaProcess.h:834
bool CanProcessViews() const override
Definition: MetaProcess.h:567
virtual void IPCSetParameters(int instance, const IsoString &messageUID, const String &parameters) const
bool EditPreferences() const override
virtual IsoString Category() const
Definition: MetaProcess.h:217
bool CanProcessGlobal() const override
Definition: MetaProcess.h:592
virtual void InitializeClass()
Definition: MetaProcess.h:517
String Description() const override
Definition: MetaProcess.h:260
Bitmap Icon() const override
uint32 Version() const override
Definition: MetaProcess.h:236
virtual IsoString IconImageSVG() const
Definition: MetaProcess.h:306
virtual IsoString Aliases() const
Definition: MetaProcess.h:175
virtual int ProcessCommandLine(const StringList &argv) const
virtual String IconImageFile() const
Definition: MetaProcess.h:430
~MetaProcess() noexcept(false) override
Definition: MetaProcess.h:119
virtual IsoString Id() const override=0
bool CanProcessImages() const override
Definition: MetaProcess.h:625
MetaProcess(const MetaProcess &)=delete
bool IsAssignable() const override
Definition: MetaProcess.h:760
virtual ProcessImplementation * Clone(const ProcessImplementation &) const =0
virtual const char ** SmallIconImageXPM() const
Definition: MetaProcess.h:463
Abstract base class for process descriptions.
Definition: ProcessBase.h:95
Implementation of a PixInsight process instance.
Client-side interface to a PixInsight process interface window.
Unicode (UTF-16) string.
Definition: String.h:8113
unsigned int uint32
Definition: Defs.h:666
size_t size_type
Definition: Defs.h:609
PCL root namespace.
Definition: AbstractImage.h:77