2026-10-25 18:52:39 +01:00
namespace AIStudio.Tools.PowerPoint ;
/// <summary>
/// What the user and the model read about the kinds of slides the user may choose layouts for.
/// </summary>
/// <remarks>
/// Each area of kinds of slides describes its members in a file of its own, one line per kind, so
/// that everything about a kind stays in one place.
/// </remarks>
internal static partial class LayoutPurposeExtensions
{
private static string TB ( string fallbackEN ) => PluginSystem . I18N . I . T ( fallbackEN , typeof ( LayoutPurposeExtensions ). Namespace , nameof ( LayoutPurposeExtensions ));
/// <summary>
/// What the forms offer for a kind of slide the user leaves to the LLM.
/// </summary>
public static string NoPreference => TB ( "No preference (the LLM decides)" );
/// <param name="purpose">The kind of slide.</param>
2026-11-04 10:46:18 +01:00
extension ( LayoutPurpose purpose )
{
/// <summary>
/// The area the forms list a kind of slide in.
/// </summary>
2026-11-04 13:00:56 +01:00
public LayoutPurposeArea Area => Describe ( purpose ). Area ;
2026-10-25 18:52:39 +01:00
2026-11-04 10:46:18 +01:00
/// <summary>
/// The short name of the choice, e.g., "Layout for chapters".
/// </summary>
2026-11-04 13:00:56 +01:00
public string Label => Describe ( purpose ). Label ;
2026-10-25 18:52:39 +01:00
2026-11-04 10:46:18 +01:00
/// <summary>
/// The question the choice answers, which says which slides it applies to.
/// </summary>
2026-11-04 13:00:56 +01:00
public string Question => Describe ( purpose ). Question ;
2026-10-25 18:52:39 +01:00
2026-11-04 10:46:18 +01:00
/// <summary>
/// Describes the slides of this kind for the model, so that it knows which of its slides a choice applies to.
/// </summary>
2026-11-04 13:00:56 +01:00
/// <value>The description, e.g., "timelines, e.g., the course of a project".</value>
public string PromptDescription => Describe ( purpose ). PromptDescription ;
2026-10-25 18:52:39 +01:00
2026-11-04 10:46:18 +01:00
/// <summary>
/// Whether choosing a layout for this kind of slide also puts such a slide into the presentation.
/// </summary>
/// <remarks>
/// For most kinds, a choice says only which layout such a slide uses, and whether the
/// presentation has one follows from its content. The slides which frame a presentation are
/// different: whoever chooses a layout for the table of contents or the imprint expects them.
/// </remarks>
2026-11-04 13:00:56 +01:00
public bool ChoiceAddsSlide => purpose . PromptPlacement is not null ;
2026-10-25 18:52:39 +01:00
2026-11-04 10:46:18 +01:00
/// <summary>
/// Where a slide goes which a choice puts into the presentation, and what it holds, for the model.
/// </summary>
2026-11-04 13:00:56 +01:00
/// <value>The rule, or null when a choice adds no slide of this kind.</value>
public string? PromptPlacement => purpose switch
2026-11-04 10:46:18 +01:00
{
LayoutPurpose . TABLE_OF_CONTENTS => "right after the title slide" ,
LayoutPurpose . Q_AND_A => "near the end, before the closing slide; where the occasion suits it, e.g., in a lecture or a workshop, also at the end of chapters, then naming the topic of the chapter" ,
LayoutPurpose . ACKNOWLEDGEMENTS => "near the end; where thanks concern a single chapter, also at the end of that chapter" ,
LayoutPurpose . REFERENCES => "near the end; it lists only the sources the content names, or else the attached documents, and never a source of your own" ,
LayoutPurpose . CLOSING => "at the end, before an appendix and the imprint" ,
LayoutPurpose . IMPRINT => "as the very last slide; it holds only what the request, the content, or the profile state, e.g., the title, the authors, the organization, and today's date, and it leaves a slot empty rather than inventing anything" ,
2026-10-25 18:52:39 +01:00
2026-11-04 10:46:18 +01:00
_ => null ,
};
2026-10-25 18:52:39 +01:00
2026-11-04 10:46:18 +01:00
/// <summary>
/// The help below the choice: its question, and whether a choice adds such a slide.
/// </summary>
2026-11-04 13:00:56 +01:00
public string Help => purpose . ChoiceAddsSlide
? $"{purpose.Question} {TB(" Choosing a layout also adds such a slide to the presentation . ")}"
: purpose . Question ;
2026-11-04 10:46:18 +01:00
}
2026-10-25 18:52:39 +01:00
private static LayoutPurposeInfo Describe ( LayoutPurpose purpose ) =>
DescribeFraming ( purpose )
?? DescribeGeneral ( purpose )
?? DescribeTeaching ( purpose )
?? DescribeBusiness ( purpose )
?? DescribeScience ( purpose )
?? DescribeMedicine ( purpose )
?? DescribeLaw ( purpose )
?? throw new ArgumentOutOfRangeException ( nameof ( purpose ), purpose , "There is no description for this kind of slide." );
}