Skip to content

Commit

Permalink
add initial SDK changes (#2209)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbonaby authored Feb 9, 2024
1 parent 43da40d commit 970a573
Show file tree
Hide file tree
Showing 34 changed files with 1,694 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include "pch.h"
#include "ApplyConfigurationResult.h"
#include "ApplyConfigurationResult.g.cpp"

namespace DevHomeSDKProjection = winrt::Microsoft::Windows::DevHome::SDK;

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
ApplyConfigurationResult::ApplyConfigurationResult(
winrt::hresult const& result,
winrt::hstring const& resultDescription,
DevHomeSDKProjection::OpenConfigurationSetResult const& openConfigurationSetResult,
DevHomeSDKProjection::ApplyConfigurationSetResult const& applyConfigurationSetResult)
: m_resultCode(result), m_resultDescription(resultDescription), m_openConfigurationSetResult(openConfigurationSetResult), m_applyConfigurationSetResult(applyConfigurationSetResult)
{
}

winrt::hresult ApplyConfigurationResult::ResultCode()
{
return m_resultCode;
}

hstring ApplyConfigurationResult::ResultDescription()
{
return m_resultDescription;
}

OpenConfigurationSetResult ApplyConfigurationResult::OpenConfigurationSetResult()
{
return m_openConfigurationSetResult;
}
ApplyConfigurationSetResult ApplyConfigurationResult::ApplyConfigurationSetResult()
{
return m_applyConfigurationSetResult;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#pragma once
#include "ApplyConfigurationResult.g.h"

namespace DevHomeSDKProjection = winrt::Microsoft::Windows::DevHome::SDK;

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
struct ApplyConfigurationResult : ApplyConfigurationResultT<ApplyConfigurationResult>
{
ApplyConfigurationResult(
winrt::hresult const& result,
winrt::hstring const& resultDescription,
DevHomeSDKProjection::OpenConfigurationSetResult const& openConfigurationSetResult,
DevHomeSDKProjection::ApplyConfigurationSetResult const& applyConfigurationSetResult);

winrt::hresult ResultCode();
hstring ResultDescription();
OpenConfigurationSetResult OpenConfigurationSetResult();
ApplyConfigurationSetResult ApplyConfigurationSetResult();

private:
winrt::hresult m_resultCode{ S_OK };
winrt::hstring m_resultDescription;
DevHomeSDKProjection::OpenConfigurationSetResult m_openConfigurationSetResult{ nullptr };
DevHomeSDKProjection::ApplyConfigurationSetResult m_applyConfigurationSetResult{ nullptr };
};
}
namespace winrt::Microsoft::Windows::DevHome::SDK::factory_implementation
{
struct ApplyConfigurationResult : ApplyConfigurationResultT<ApplyConfigurationResult, implementation::ApplyConfigurationResult>
{
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "pch.h"
#include "ApplyConfigurationSetResult.h"
#include "ApplyConfigurationSetResult.g.cpp"

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
ApplyConfigurationSetResult::ApplyConfigurationSetResult(winrt::hresult const& result, IVectorView<DevHomeSDKProjection::ApplyConfigurationUnitResult> const& unitResults)
: m_resultCode(result), m_unitResults(unitResults)
{
}

IVectorView<DevHomeSDKProjection::ApplyConfigurationUnitResult> ApplyConfigurationSetResult::UnitResults()
{
return m_unitResults;
}

winrt::hresult ApplyConfigurationSetResult::ResultCode()
{
return m_resultCode;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#pragma once
#include "ApplyConfigurationSetResult.g.h"

namespace DevHomeSDKProjection = winrt::Microsoft::Windows::DevHome::SDK;

using namespace winrt::Windows::Foundation::Collections;

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
struct ApplyConfigurationSetResult : ApplyConfigurationSetResultT<ApplyConfigurationSetResult>
{
ApplyConfigurationSetResult(winrt::hresult const& result, IVectorView<DevHomeSDKProjection::ApplyConfigurationUnitResult> const& unitResults);
IVectorView<ApplyConfigurationUnitResult> UnitResults();
winrt::hresult ResultCode();

private:
winrt::hresult m_resultCode { S_OK };
IVectorView<DevHomeSDKProjection::ApplyConfigurationUnitResult> m_unitResults{ nullptr };
};
}
namespace winrt::Microsoft::Windows::DevHome::SDK::factory_implementation
{
struct ApplyConfigurationSetResult : ApplyConfigurationSetResultT<ApplyConfigurationSetResult, implementation::ApplyConfigurationSetResult>
{
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include "pch.h"
#include "ApplyConfigurationUnitResult.h"
#include "ApplyConfigurationUnitResult.g.cpp"

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
ApplyConfigurationUnitResult::ApplyConfigurationUnitResult(ConfigurationUnit const& unit, bool previouslyInDesiredState, bool rebootRequired, ConfigurationUnitResultInformation const& resultInformation)
: m_unit(unit), m_previouslyInDesiredState(previouslyInDesiredState), m_rebootRequired(rebootRequired), m_resultInformation(resultInformation)
{
}

ConfigurationUnit ApplyConfigurationUnitResult::Unit()
{
return m_unit;
}

bool ApplyConfigurationUnitResult::PreviouslyInDesiredState()
{
return m_previouslyInDesiredState;
}

bool ApplyConfigurationUnitResult::RebootRequired()
{
return m_rebootRequired;
}

ConfigurationUnitResultInformation ApplyConfigurationUnitResult::ResultInformation()
{
return m_resultInformation;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma once
#include "ApplyConfigurationUnitResult.g.h"

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
struct ApplyConfigurationUnitResult : ApplyConfigurationUnitResultT<ApplyConfigurationUnitResult>
{
ApplyConfigurationUnitResult(ConfigurationUnit const& unit, bool previouslyInDesiredState, bool rebootRequired, ConfigurationUnitResultInformation const& resultInformation);
ConfigurationUnit Unit();
bool PreviouslyInDesiredState();
bool RebootRequired();
ConfigurationUnitResultInformation ResultInformation();

private:
ConfigurationUnit m_unit{ nullptr };
ConfigurationUnitState m_state{ ConfigurationUnitState::Unknown };
bool m_previouslyInDesiredState{ false };
bool m_rebootRequired{ false };
ConfigurationUnitResultInformation m_resultInformation{ nullptr };
};
}
namespace winrt::Microsoft::Windows::DevHome::SDK::factory_implementation
{
struct ApplyConfigurationUnitResult : ApplyConfigurationUnitResultT<ApplyConfigurationUnitResult, implementation::ApplyConfigurationUnitResult>
{
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "pch.h"
#include "ComputeSystemAdaptiveCardResult.h"
#include "ComputeSystemAdaptiveCardResult.g.cpp"

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
ComputeSystemAdaptiveCardResult::ComputeSystemAdaptiveCardResult(IExtensionAdaptiveCardSession2 const& cardSession)
: m_computeSystemCardSession(cardSession), m_result(ProviderOperationStatus::Success, S_OK, hstring{}, hstring{})
{
}

ComputeSystemAdaptiveCardResult::ComputeSystemAdaptiveCardResult(winrt::hresult const& e, hstring const& diagnosticText)
: m_computeSystemCardSession(nullptr), m_result(ProviderOperationStatus::Failure, e, hstring{}, diagnosticText)
{
}
winrt::Microsoft::Windows::DevHome::SDK::IExtensionAdaptiveCardSession2 ComputeSystemAdaptiveCardResult::ComputeSystemCardSession()
{
return m_computeSystemCardSession;
}

winrt::Microsoft::Windows::DevHome::SDK::ProviderOperationResult ComputeSystemAdaptiveCardResult::Result()
{
return m_result;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once
#include "ComputeSystemAdaptiveCardResult.g.h"

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
struct ComputeSystemAdaptiveCardResult : ComputeSystemAdaptiveCardResultT<ComputeSystemAdaptiveCardResult>
{
ComputeSystemAdaptiveCardResult(IExtensionAdaptiveCardSession2 const& cardSession);
ComputeSystemAdaptiveCardResult(winrt::hresult const& e, hstring const& diagnosticText);
IExtensionAdaptiveCardSession2 ComputeSystemCardSession();
ProviderOperationResult Result();

private:
IExtensionAdaptiveCardSession2 m_computeSystemCardSession;
ProviderOperationResult m_result;
};
}
namespace winrt::Microsoft::Windows::DevHome::SDK::factory_implementation
{
struct ComputeSystemAdaptiveCardResult : ComputeSystemAdaptiveCardResultT<ComputeSystemAdaptiveCardResult, implementation::ComputeSystemAdaptiveCardResult>
{
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include "pch.h"
#include "ComputeSystemOperationData.h"
#include "ComputeSystemOperationData.g.cpp"

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
ComputeSystemOperationData::ComputeSystemOperationData(hstring const& operationStatus, uint32_t operationProgress)
: m_status(operationStatus), m_progress(operationProgress)
{
}

hstring ComputeSystemOperationData::Status()
{
return m_status;
}
uint32_t ComputeSystemOperationData::Progress()
{
return m_progress;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once
#include "ComputeSystemOperationData.g.h"

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
struct ComputeSystemOperationData : ComputeSystemOperationDataT<ComputeSystemOperationData>
{
ComputeSystemOperationData(hstring const& OperationStatus, uint32_t OperationProgress);
hstring Status();
uint32_t Progress();

private:
hstring m_status;
uint32_t m_progress;
};
}
namespace winrt::Microsoft::Windows::DevHome::SDK::factory_implementation
{
struct ComputeSystemOperationData : ComputeSystemOperationDataT<ComputeSystemOperationData, implementation::ComputeSystemOperationData>
{
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "pch.h"
#include "ComputeSystemOperationResult.h"
#include "ComputeSystemOperationResult.g.cpp"

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
ComputeSystemOperationResult::ComputeSystemOperationResult()
: m_result(ProviderOperationStatus::Success, S_OK, hstring(), hstring())
{
}

ComputeSystemOperationResult::ComputeSystemOperationResult(winrt::hresult const& e, hstring const& diagnosticText)
: m_result(ProviderOperationStatus::Failure, e, diagnosticText, diagnosticText)
{
}

winrt::Microsoft::Windows::DevHome::SDK::ProviderOperationResult ComputeSystemOperationResult::Result()
{
return m_result;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once
#include "ComputeSystemOperationResult.g.h"

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
struct ComputeSystemOperationResult : ComputeSystemOperationResultT<ComputeSystemOperationResult>
{
ComputeSystemOperationResult();
ComputeSystemOperationResult(winrt::hresult const& e, hstring const& diagnosticText);
ProviderOperationResult Result();

private:
ProviderOperationResult m_result;
};
}
namespace winrt::Microsoft::Windows::DevHome::SDK::factory_implementation
{
struct ComputeSystemOperationResult : ComputeSystemOperationResultT<ComputeSystemOperationResult, implementation::ComputeSystemOperationResult>
{
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include "pch.h"
#include "ComputeSystemProperty.h"
#include "ComputeSystemProperty.g.cpp"

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
ComputeSystemProperty::ComputeSystemProperty(Uri const& icon, hstring const& propertyName, IInspectable const& propertyValue, ComputeSystemPropertyKind const& propertyKind)
: m_icon(icon), m_name(propertyName), m_value(propertyValue), m_propertyKind(propertyKind)
{
}

ComputeSystemProperty::ComputeSystemProperty(hstring const& propertyName, IInspectable const& propertyValue, ComputeSystemPropertyKind const& propertyKind)
: m_icon(nullptr), m_name(propertyName), m_value(propertyValue), m_propertyKind(propertyKind)
{
}

ComputeSystemProperty::ComputeSystemProperty(IInspectable const& propertyValue, ComputeSystemPropertyKind const& propertyKind) :
m_icon(nullptr), m_name(hstring{}), m_value(propertyValue), m_propertyKind(propertyKind)
{
}

Uri ComputeSystemProperty::Icon()
{
return m_icon;
}

hstring ComputeSystemProperty::Name()
{
return m_name;
}

winrt::Windows::Foundation::IInspectable ComputeSystemProperty::Value()
{
return m_value;
}

ComputeSystemPropertyKind ComputeSystemProperty::PropertyKind()
{
return m_propertyKind;
}
}
30 changes: 30 additions & 0 deletions extensionsdk/Microsoft.Windows.DevHome.SDK/ComputeSystemProperty.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#pragma once
#include "ComputeSystemProperty.g.h"

using namespace winrt::Windows::Foundation;

namespace winrt::Microsoft::Windows::DevHome::SDK::implementation
{
struct ComputeSystemProperty : ComputeSystemPropertyT<ComputeSystemProperty>
{
ComputeSystemProperty(Uri const& icon, hstring const& propertyName, IInspectable const& propertyValue, ComputeSystemPropertyKind const& propertyKind);
ComputeSystemProperty(hstring const& propertyName, IInspectable const& propertyValue, ComputeSystemPropertyKind const& propertyKind);
ComputeSystemProperty(IInspectable const& propertyValue, ComputeSystemPropertyKind const& propertyKind);
Uri Icon();
hstring Name();
IInspectable Value();
ComputeSystemPropertyKind PropertyKind();

private:
Uri m_icon;
hstring m_name;
IInspectable m_value;
ComputeSystemPropertyKind m_propertyKind;
};
}
namespace winrt::Microsoft::Windows::DevHome::SDK::factory_implementation
{
struct ComputeSystemProperty : ComputeSystemPropertyT<ComputeSystemProperty, implementation::ComputeSystemProperty>
{
};
}
Loading

0 comments on commit 970a573

Please sign in to comment.