PCL
MetaProcess.h
Go to the documentation of this file.
1 // ____ ______ __
2 // / __ \ / ____// /
3 // / /_/ // / / /
4 // / ____// /___ / /___ PixInsight Class Library
5 // /_/ \____//_____/ PCL 2.9.3
6 // ----------------------------------------------------------------------------
7 // pcl/MetaProcess.h - Released 2025-02-21T12:13:32Z
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-2025 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/Property.h>
65 #include <pcl/StringList.h>
66 
67 namespace pcl
68 {
69 
70 // ----------------------------------------------------------------------------
71 
72 class View;
73 class ImageWindow;
74 class ProcessImplementation;
75 class ProcessInterface;
76 class MetaParameter;
77 
107 class PCL_CLASS MetaProcess : public MetaObject, public ProcessBase
108 {
109 public:
110 
115 
120  ~MetaProcess() noexcept( false ) override
121  {
122  }
123 
128  MetaProcess( const MetaProcess& ) = delete;
129 
134  MetaProcess& operator =( const MetaProcess& ) = delete;
135 
140  MetaProcess( MetaProcess&& x ) = delete;
141 
146  MetaProcess& operator =( MetaProcess&& x ) = delete;
147 
150  virtual IsoString Id() const override = 0;
151 
176  virtual IsoString Aliases() const
177  {
178  return IsoString();
179  }
180 
206  virtual IsoString Categories() const
207  {
208  return IsoString(); // General category
209  }
210 
218  virtual IsoString Category() const // ### PCL 2.x: Remove
219  {
220  return Categories();
221  }
222 
237  uint32 Version() const override
238  {
239  return 0x100;
240  }
241 
261  String Description() const override
262  {
263  return String();
264  }
265 
277  String ScriptComment() const override
278  {
279  return String();
280  }
281 
307  virtual IsoString IconImageSVG() const
308  {
309  return IsoString();
310  }
311 
374  virtual String IconImageSVGFile() const
375  {
376  return String();
377  }
378 
405  virtual const char** IconImageXPM() const
406  {
407  return nullptr;
408  }
409 
431  virtual String IconImageFile() const
432  {
433  return String();
434  }
435 
464  virtual const char** SmallIconImageXPM() const
465  {
466  return nullptr;
467  }
468 
487  virtual String SmallIconImageFile() const
488  {
489  return String();
490  }
491 
494  Bitmap Icon() const override;
495 
498  Bitmap SmallIcon() const override;
499 
518  virtual void InitializeClass()
519  {
520  }
521 
548  {
549  return nullptr; // by default, processes have no associated interfaces.
550  }
551 
568  bool CanProcessViews() const override
569  {
570  return true;
571  }
572 
593  bool CanProcessGlobal() const override
594  {
595  return true;
596  }
597 
626  bool CanProcessImages() const override
627  {
628  return false;
629  }
630 
644  bool CanProcessCommandLines() const override
645  {
646  return false;
647  }
648 
661  bool CanEditPreferences() const override
662  {
663  return false;
664  }
665 
686  bool CanBrowseDocumentation() const override
687  {
688  return true;
689  }
690 
704  virtual ProcessImplementation* Create() const = 0;
705 
717  virtual ProcessImplementation* Clone( const ProcessImplementation& ) const = 0;
718 
745  {
746  return Clone( p );
747  }
748 
761  bool IsAssignable() const override
762  {
763  return true; // by default, processes are considered assignable.
764  }
765 
792  bool NeedsInitialization() const override
793  {
794  return false; // by default, process instances are not initialized.
795  }
796 
814  bool NeedsValidation() const override
815  {
816  return false; // by default, process instances are not validated.
817  }
818 
835  bool PrefersGlobalExecution() const override
836  {
837  return false; // by default, processes prefer execution on views.
838  }
839 
851  virtual int ProcessCommandLine( const StringList& argv ) const;
852 
870  bool EditPreferences() const override;
871 
892  bool BrowseDocumentation() const override;
893 
901  const MetaParameter* operator[]( size_type i ) const;
902 
934  virtual bool CanProcessIPCMessages() const
935  {
936  return false;
937  }
938 
958  virtual void IPCStart( int instance, const IsoString& messageUID, const String& parameters ) const;
959 
974  virtual void IPCStop( int instance, const IsoString& messageUID ) const;
975 
995  virtual void IPCSetParameters( int instance, const IsoString& messageUID, const String& parameters ) const;
996 
1021  virtual int IPCStatus( int instance, const IsoString& messageUID ) const;
1022 
1052  Property SignatureProperty( const IsoString& taskId ) const;
1053 
1054 private:
1055 
1056  void PerformAPIDefinitions() const override;
1057 };
1058 
1059 // ----------------------------------------------------------------------------
1060 
1061 } // pcl
1062 
1063 #endif // __PCL_BUILDING_PIXINSIGHT_APPLICATION
1064 
1065 #endif // __PCL_MetaProcess_h
1066 
1067 // ----------------------------------------------------------------------------
1068 // EOF pcl/MetaProcess.h - Released 2025-02-21T12:13:32Z
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:5445
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:108
virtual const char ** IconImageXPM() const
Definition: MetaProcess.h:405
virtual ProcessImplementation * Create() const =0
virtual void IPCStart(int instance, const IsoString &messageUID, const String &parameters) const
bool NeedsInitialization() const override
Definition: MetaProcess.h:792
virtual IsoString Categories() const
Definition: MetaProcess.h:206
virtual String IconImageSVGFile() const
Definition: MetaProcess.h:374
String ScriptComment() const override
Definition: MetaProcess.h:277
virtual bool CanProcessIPCMessages() const
Definition: MetaProcess.h:934
virtual ProcessImplementation * TestClone(const ProcessImplementation &p) const
Definition: MetaProcess.h:744
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:547
bool CanProcessCommandLines() const override
Definition: MetaProcess.h:644
Property SignatureProperty(const IsoString &taskId) const
bool CanEditPreferences() const override
Definition: MetaProcess.h:661
bool BrowseDocumentation() const override
MetaProcess(MetaProcess &&x)=delete
bool CanBrowseDocumentation() const override
Definition: MetaProcess.h:686
const MetaParameter * operator[](size_type i) const
bool NeedsValidation() const override
Definition: MetaProcess.h:814
virtual String SmallIconImageFile() const
Definition: MetaProcess.h:487
Bitmap SmallIcon() const override
bool PrefersGlobalExecution() const override
Definition: MetaProcess.h:835
bool CanProcessViews() const override
Definition: MetaProcess.h:568
virtual void IPCSetParameters(int instance, const IsoString &messageUID, const String &parameters) const
bool EditPreferences() const override
virtual IsoString Category() const
Definition: MetaProcess.h:218
bool CanProcessGlobal() const override
Definition: MetaProcess.h:593
virtual void InitializeClass()
Definition: MetaProcess.h:518
String Description() const override
Definition: MetaProcess.h:261
Bitmap Icon() const override
uint32 Version() const override
Definition: MetaProcess.h:237
virtual IsoString IconImageSVG() const
Definition: MetaProcess.h:307
virtual IsoString Aliases() const
Definition: MetaProcess.h:176
virtual int ProcessCommandLine(const StringList &argv) const
virtual String IconImageFile() const
Definition: MetaProcess.h:431
~MetaProcess() noexcept(false) override
Definition: MetaProcess.h:120
virtual IsoString Id() const override=0
bool CanProcessImages() const override
Definition: MetaProcess.h:626
MetaProcess(const MetaProcess &)=delete
bool IsAssignable() const override
Definition: MetaProcess.h:761
virtual ProcessImplementation * Clone(const ProcessImplementation &) const =0
virtual const char ** SmallIconImageXPM() const
Definition: MetaProcess.h:464
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.
An identifier-value association.
Definition: Property.h:79
Unicode (UTF-16) string.
Definition: String.h:8148
unsigned int uint32
Definition: Defs.h:666
size_t size_type
Definition: Defs.h:609
PCL root namespace.
Definition: AbstractImage.h:77