winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

ConfigurationUnit.h (3592B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #pragma once
      4 #include "ConfigurationUnit.g.h"
      5 #include "ConfigurationEnvironment.h"
      6 #include <winget/ILifetimeWatcher.h>
      7 #include <winget/ModuleCountBase.h>
      8 #include <winrt/Windows.Foundation.Collections.h>
      9 #include <vector>
     10 
     11 namespace winrt::Microsoft::Management::Configuration::implementation
     12 {
     13     struct ConfigurationUnit : ConfigurationUnitT<ConfigurationUnit, winrt::cloaked<AppInstaller::WinRT::ILifetimeWatcher>>, AppInstaller::WinRT::LifetimeWatcherBase, AppInstaller::WinRT::ModuleCountBase
     14     {
     15         ConfigurationUnit();
     16 
     17 #if !defined(INCLUDE_ONLY_INTERFACE_METHODS)
     18         ConfigurationUnit(const guid& instanceIdentifier);
     19 
     20         implementation::ConfigurationEnvironment& EnvironmentInternal();
     21 #endif
     22 
     23         hstring Type();
     24         void Type(const hstring& value);
     25 
     26         guid InstanceIdentifier();
     27 
     28         hstring Identifier();
     29         void Identifier(const hstring& value);
     30 
     31         ConfigurationUnitIntent Intent();
     32         void Intent(ConfigurationUnitIntent value);
     33 
     34         Windows::Foundation::Collections::IVector<hstring> Dependencies();
     35         void Dependencies(const Windows::Foundation::Collections::IVector<hstring>& value);
     36 
     37         Windows::Foundation::Collections::ValueSet Metadata();
     38         void Metadata(const Windows::Foundation::Collections::ValueSet& value);
     39 
     40         Windows::Foundation::Collections::ValueSet Settings();
     41         void Settings(const Windows::Foundation::Collections::ValueSet& value);
     42 
     43         IConfigurationUnitProcessorDetails Details();
     44 
     45         ConfigurationUnitState State();
     46 
     47         IConfigurationUnitResultInformation ResultInformation();
     48 
     49         bool IsActive();
     50         void IsActive(bool value);
     51 
     52         Configuration::ConfigurationUnit Copy();
     53 
     54         bool IsGroup();
     55         void IsGroup(bool value);
     56 
     57         Windows::Foundation::Collections::IVector<Configuration::ConfigurationUnit> Units();
     58         void Units(const Windows::Foundation::Collections::IVector<Configuration::ConfigurationUnit>& value);
     59 
     60         Configuration::ConfigurationEnvironment Environment();
     61 
     62         HRESULT STDMETHODCALLTYPE SetLifetimeWatcher(IUnknown* watcher);
     63 
     64 #if !defined(INCLUDE_ONLY_INTERFACE_METHODS)
     65         void Dependencies(std::vector<hstring>&& value);
     66         void Details(IConfigurationUnitProcessorDetails details);
     67         void Units(std::vector<Configuration::ConfigurationUnit>&& value);
     68 
     69     private:
     70         hstring m_type;
     71         guid m_instanceIdentifier;
     72         hstring m_identifier;
     73         ConfigurationUnitIntent m_intent = ConfigurationUnitIntent::Apply;
     74         Windows::Foundation::Collections::IVector<hstring> m_dependencies{ winrt::multi_threaded_vector<hstring>() };
     75         Windows::Foundation::Collections::ValueSet m_metadata;
     76         Windows::Foundation::Collections::ValueSet m_settings;
     77         IConfigurationUnitProcessorDetails m_details{ nullptr };
     78         bool m_isActive = true;
     79         bool m_isGroup = false;
     80         Windows::Foundation::Collections::IVector<Configuration::ConfigurationUnit> m_units = nullptr;
     81         com_ptr<implementation::ConfigurationEnvironment> m_environment{ make_self<implementation::ConfigurationEnvironment>() };
     82 #endif
     83     };
     84 }
     85 
     86 #if !defined(INCLUDE_ONLY_INTERFACE_METHODS)
     87 namespace winrt::Microsoft::Management::Configuration::factory_implementation
     88 {
     89     struct ConfigurationUnit : ConfigurationUnitT<ConfigurationUnit, implementation::ConfigurationUnit>
     90     {
     91     };
     92 }
     93 #endif